Quote from BitwiseI know i've seen threads about this, but I can't for the life of me find them.
What is the most efficient way to create a timer? I need to run a piece of code every five seconds.
Quote from BitwiseActually, this is what I already had. It just seems to me that running code for a timer say, 60 times a second is overkill.
local frame = CreateFrame('Frame')
local timer = 0
frame:SetScript('OnUpdate', function(self, elapsed)
timer = timer + elapsed
if timer >= 5 then
timer = 0