SetTimerEx taking more time
#1

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.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=289675
Reply
#3

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.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)