Skip to content

Instantly share code, notes, and snippets.

@abma
Last active August 29, 2015 14:02
Show Gist options
  • Save abma/6ba967cb137c811449ed to your computer and use it in GitHub Desktop.
Save abma/6ba967cb137c811449ed to your computer and use it in GitHub Desktop.
springrts.com widget to show frames which consumed a lot of time
function widget:GetInfo()
return {
name = "LAG INFO",
desc = "abcdef",
author = "abcdef",
date = "abcdef",
license = "abcdef",
layer = 0,
enabled = true, -- loaded by default?
}
end
local last = Spring.GetTimer()
function widget:GameFrame(frame)
local cur = Spring.GetTimer()
diff = Spring.DiffTimers(cur, last, true)
last = cur
if diff > 100 then
Spring.Echo("GameFrame() delay: "..tostring(diff))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment