I want to create a 25 ms loop but I noticed one problem.
local timer = {}
addEvent("onClient25MsLoop",true)
timer[1] = setTimer(function()
timer[2] = setTimer(function()
triggerEvent("onClient25MsLoop",root)
end,50,0)
end,50,1)
timer[3] = setTimer(function()
timer[4] = setTimer(function()
triggerEvent("onClient25MsLoop",root)
end,50,0)
end,75,1)
addEventHandler("onClient25MsLoop",root,function()
outputChatBox(getTickCount()) ----------every output should differ by 25 ms
end)
setTimer(function()
killTimer(timer[2])
killTimer(timer[4])
end,2000,1)
Well,I set two 50-ms-loop timers.One with 50 ms delay and the other with 75 ms delay(they differ by 25 ms).At first several milliseconds,they work prefect,but after a second,they go wrong.
The 25-ms-difference become invalid.