Thanks for the insight everyone, worth a read
I figured that a time lookup would be too light to put in a condition and give its own counter. I just update that every second. I did give latency its own update frequency though.
Code:
local _, _, home, world = GetNetStats()
local last = 0
local lastLag = 0
f:SetScript("OnUpdate", function(self, elapsed)
last = last + elapsed
lastLag = lastLag + elapsed
if lastLag >= 10 then
_, _, home, world = GetNetStats()
lastLag = 0
end
if last >= 1 then
text:SetText("|cffffffff"..ceil(GetFramerate()).."|r fps |cffffffff"..home.."|r/|cffffffff"..world.."|r ms |cffffffff"..date("%H:%M"))
last = 0
end
end)