loq_profiler

Corona frame rate, application memory and texture memory profiler.  Ported from shanem’s AS3 com.flashdynamix.utils.SWFProfiler

Usage

require("loq_profiler").createProfiler()
Summary
loq_profilerCorona frame rate, application memory and texture memory profiler.
Functions
createProfilerCreates and returns a display instance of the profiler.
destroyProfilerDestroys the Profiler removing it from the stage.
ProfilerCreates a display group instance that displays graphs for frame rate and memory usage.
Methods
averageFpsReturns: Average frames per second.
currentFpsCurrent frames per second.
currentMemApplication memory in kilobytes
currentTextureMemTexture memory used in kilobytes.
resizeResize the Profiler to adjust it to the display’s orientation.
runningTimeRunning time of the application in seconds.

Functions

createProfiler

local function createProfiler(_onTop,
_collect)

Creates and returns a display instance of the profiler.

Usage

require(“loq_profiler”).createProfiler()

Parameters

  • _onTop Forces the profiler to stay on top.  If true stays on top, otherwise can be hidden by other display objects.  Default is true.
  • _collect Forces a garbage collection step every frame.  If true forces a collection, otherwise lets the gc run normally.  Default is true.

Returns

A display group instance of the profiler.

destroyProfiler

local function destroyProfiler()

Destroys the Profiler removing it from the stage.

Usage

require(“loq_profiler”).destroyProfiler()

Profiler

Creates a display group instance that displays graphs for frame rate and memory usage.

Summary
Methods
averageFpsReturns: Average frames per second.
currentFpsCurrent frames per second.
currentMemApplication memory in kilobytes
currentTextureMemTexture memory used in kilobytes.
resizeResize the Profiler to adjust it to the display’s orientation.
runningTimeRunning time of the application in seconds.

Methods

averageFps

function Profiler:averageFps()

Returns: Average frames per second.

currentFps

function Profiler:currentFps()

Returns

Current frames per second.

currentMem

function Profiler:currentMem()

Returns

Application memory in kilobytes

currentTextureMem

function Profiler:currentTextureMem()

Returns

Texture memory used in kilobytes.

resize

function Profiler:resize()

Resize the Profiler to adjust it to the display’s orientation.

runningTime

function Profiler:runningTime()

Returns

Running time of the application in seconds.

local function createProfiler(_onTop,
_collect)
Creates and returns a display instance of the profiler.
local function destroyProfiler()
Destroys the Profiler removing it from the stage.
function Profiler:averageFps()
Returns: Average frames per second.
function Profiler:currentFps()
Current frames per second.
function Profiler:currentMem()
Application memory in kilobytes
function Profiler:currentTextureMem()
Texture memory used in kilobytes.
function Profiler:resize()
Resize the Profiler to adjust it to the display’s orientation.
function Profiler:runningTime()
Running time of the application in seconds.
Close