12.10.2010, 11:03
While I do not disagree with the logic here, especially for very frequent ( or short ) timers, I am sceptical as to the efficiency of putting an entire scripts worth of timers under OnPlayerUpdate. Particularly for things which might be checked every 10 minutes or more.
I would be interested to know if it would still be more efficient to check unix time vs a variable 12,000 times, rather than doing one larger computation under a repeating 10 minute timer.
To put this in perspective, in my script I often use a repeating 1 minute timer to manipulate variables that have been set according to how many minutes I want the 'cooldown' period to be. Eg If I want to block a player from repairing a vehicle for 5 minutes, I will set 'repairtime[playerid]' to 5, and decrement it under the aforementioned 1 minute timer.
I consider this to be neater, and assume it is more efficient than a new SetTimerEx("function","d",playerid); for each player.
Tell me what you think.
I would be interested to know if it would still be more efficient to check unix time vs a variable 12,000 times, rather than doing one larger computation under a repeating 10 minute timer.
To put this in perspective, in my script I often use a repeating 1 minute timer to manipulate variables that have been set according to how many minutes I want the 'cooldown' period to be. Eg If I want to block a player from repairing a vehicle for 5 minutes, I will set 'repairtime[playerid]' to 5, and decrement it under the aforementioned 1 minute timer.
I consider this to be neater, and assume it is more efficient than a new SetTimerEx("function","d",playerid); for each player.
Tell me what you think.