Last active
August 29, 2015 14:02
-
-
Save abma/6ba967cb137c811449ed to your computer and use it in GitHub Desktop.
springrts.com widget to show frames which consumed a lot of time
This file contains 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
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