Originally Posted by nightcracker
<snip>So if you run at 120 FPS your calling a sin function 120 times per second.<snip>
|
Not true.
Code:
do
local last_update = 0
local updater = CreateFrame("Frame", nil, UIParent)
updater:Hide()
updater:SetScript("OnUpdate",
function(self, elapsed)
last_update = last_update + elapsed
if last_update >= 0.25 then
RunSinFunction()
last_update = 0
end
end)
end
That executes the sin function every quarter of a second.