SA-MP Forums Archive
About timers. - 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: About timers. (/showthread.php?tid=392190)



About timers. - budelis - 13.11.2012

Hi,

I have timer with 1 sec interval it's repeating timer. I want to ask, if i do a loop 500 times and it took 2 sec, what happin then if that functions take longer time, than my timer interval? or maybe timer is called again then when all function is complete in timer?


Re: About timers. - iggy1 - 13.11.2012

Server will hang, i beleive function calls and stuff will get queued and the server will hang untill everything has finished executing.

EDIT: You shouldn't really put any code in a timer that takes longer to execute than the time set by the timer, you will get constant lag.


Re: About timers. - XtremeR - 13.11.2012

i believe the server will hang...


Re: About timers. - budelis - 13.11.2012

Код:
foreach(new i : Player)
{
SendClientMessage( i, -1,"TEST");
}
How much it took time, if i have in my server 500 players?