SetTimerEx taking more time - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetTimerEx taking more time (
/showthread.php?tid=542111)
SetTimerEx taking more time -
TwinkiDaBoss - 17.10.2014
Alright so, this is more a question and any sort of help thread.
So okay I got simple timer to check something for the player (Example: SetTimerEx("Test",60000,true,"i",playerid))
but instead of it taking 60 seconds it actualy takes 66 seconds. Is this something normal with a script long lets roughly say 2500-3000 lines, or I did I fuck somewhere else in the code?
EDIT: Running script on localhost.
Re: SetTimerEx taking more time -
Pottus - 17.10.2014
https://sampforum.blast.hk/showthread.php?tid=289675
Re: SetTimerEx taking more time -
SickAttack - 17.10.2014
https://sampforum.blast.hk/showthread.php?tid=375925
Quote:
Originally Posted by ******
SetTimer(Ex)
These functions are not very accurate and that they don't correctly support strings and arrays. Both these problems are now fixed to the best of my ability. I should note that the accuracy is still a little off because of the "sleep" call in the server internally, but they're MUCH better now.
I've also improved their performance through the use of "std::priority_queue" so the next timers to trigger are always at the top of the list.
A note when passing arrays, as with "CallLocalFunction" you MUST follow the array with its length as an extra parameter or the system has no way to know how big it is:
pawn Код:
SetTimerEx("func", 1000, 0, "ai", arr, sizeof (arr));
These functions are not changed in ANY way, "0" still means "run once", anything else still means "run forever". You don't even need to recompile to use the new versions, just use the plugin.
|
Re: SetTimerEx taking more time -
TwinkiDaBoss - 17.10.2014
Thanks guys.
Timefix did really help!
[03:24:44] - 1 min has expired
[03:25:44] - 1 min has expired
[03:26:44] - 1 min has expired
[03:27:44] - 1 min has expired
Accurate, really really nice