Created
March 24, 2022 16:47
-
-
Save EngineerSmith/5b4e3a2c3ee627f2485472f736f23901 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local counter -- Recommedned to reuse tables for commonly used counters | |
function state:update(dt) | |
counter = appleCake.counter("State", {"value"=self.value, "valueZ"=self.valueZ}, counter) -- You can create overlapping bar graphs | |
end | |
-- record memory each update | |
local memory | |
function love.update(dt) | |
memory = appleCake.counter("Memory", {"kb"=collectgarbage("count")}, memory) | |
end | |
-- or use the premade memory function | |
local mem = 0 | |
function love.update(dt) | |
mem = mem + dt | |
if mem > 0.1 then | |
appleCake.countMemory("byte") -- Count memory for you in bytes; each 0.1 seconds | |
mem = 0 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment