[QUESTION] what's better - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [QUESTION] what's better (
/showthread.php?tid=128455)
[QUESTION] what's better -
shady91 - 17.02.2010
what would you say's less lag two timers with doing its own function in each of them or one timer with both function in the one callback?
Re: [QUESTION] what's better -
Joe Staff - 17.02.2010
For less lag towards the players, 2 timers that 'DO NOT' intersect eachother (or otherwise execute at the same time) so run one at '1000' ms and the other at '999' ms.
Re: [QUESTION] what's better -
shady91 - 17.02.2010
Quote:
Originally Posted by Joe Staff
For less lag towards the players, 2 timers that 'DO NOT' intersect eachother (or otherwise execute at the same time) so run one at '1000' ms and the other at '999' ms.
|
wouldn't it be better to put both callbacks into one callback or shall i do it how you said.
Re: [QUESTION] what's better -
Joe Staff - 17.02.2010
****** has made an entire tutorial and function for this kind of thing, go searching through his stuff.
Re: [QUESTION] what's better -
shady91 - 17.02.2010
Quote:
Originally Posted by Joe Staff
****** has made an entire tutorial and function for this kind of thing, go searching through his stuff.
|
lol yeah i saw that topic i just never got to the bottom of it before i got tired.
Re: [QUESTION] what's better -
Sergei - 17.02.2010
If you are processing functions for players then definitely OnPlayerUpdate with ticks. Otherwise one timer, two functions from my side.
Re: [QUESTION] what's better -
shady91 - 17.02.2010
Quote:
Originally Posted by $ЂЯĢ
If you are processing functions for players then definitely OnPlayerUpdate with ticks. Otherwise one timer, two functions from my side.
|
so one timer 2 function's is less lag then having two timer one 1999 and the other 2000?
Re: [QUESTION] what's better -
woot - 17.02.2010
Unless you expect 500 players on your server, or you suck at scripting that you can't optimize your code, it should not be any noticable difference.
Re: [QUESTION] what's better -
shady91 - 17.02.2010
Quote:
Originally Posted by //exora
Unless you expect 500 players on your server, or you suck at scripting that you can't optimize your code, it should not be any noticable difference.
|
no i don't have 500 players and i am optimizing my code, i just wasn't to sure what worked faster on timers.