Skip to content

Instantly share code, notes, and snippets.

@EngineerSmith
Created March 24, 2022 16:47
Show Gist options
  • Save EngineerSmith/5b4e3a2c3ee627f2485472f736f23901 to your computer and use it in GitHub Desktop.
Save EngineerSmith/5b4e3a2c3ee627f2485472f736f23901 to your computer and use it in GitHub Desktop.
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