-
-
Notifications
You must be signed in to change notification settings - Fork 26
Stats
The Slab API offers functions that track the performance of desired sections of code. With these functions coupled together with the debug performance window, end-users will be able to see bottlenecks located within their code base quickly. To display the performance window, call the SlabDebug.Performance function.
Below is a list of functions associated with the Stats API.
Starts the timer for the specific stat in the given category.
Parameter | Type | Description |
---|---|---|
Name | String | The name of the stat to capture. |
Category | String | The category this stat belongs to. |
Return | Description |
---|---|
Number | The handle identifying this stat capture. |
Ends the timer for the stat assigned to the given handle.
Parameter | Type | Description |
---|---|---|
Number | The handle identifying a BeginStat call. |
Sets the enabled state of the stats system. The system is disabled by default.
Parameter | Type | Description |
---|---|---|
Enable | Boolean | The new state of the states system. |
Query whether the stats system is enabled or disabled.
Return | Description |
---|---|
Boolean | Returns whether the stats system is enabled or disabled. |
Resets the stats system to an empty state.
Get the love.graphics.getStats of the Slab. Stats.SetEnabled(true) must be previously set to enable this. Must be called in love.draw (recommended at the end of draw)
Return | Description |
---|---|
Table | Returns a table similar to love.graphics.getStats() of Slabs stats. |
Calculate the passed love.graphics.getStats table of love by subtracting the stats of Slab. Stats.SetEnabled(true) must be previously set to enable this. Must be called in love.draw (recommended at the end of draw). For code example, check issue #91
Parameter | Type | Description |
---|---|---|
LoveStats | Table | table of love.graphics.getStats(). |
Return | Description |
---|---|
Table | Returns a modified LoveStats table (subtracted the stats used by Slab). |