Which is faster? (Timers)
#1

20 timers that checks if the player is in range of one point each, or 1 timer that checks if the player is in range of one of 20 points?

I'm making a script where the player will gradually loose HP in some areas, and I need to know what method to use.
Reply
#2

In my opinion the speed would be similar for both, you could check the efficiency by using
pawn Код:
tickcount(); // time.inc
For neatness and simplicity I would pick the latter of the two options.
Reply
#3

One timer. Why have nineteen more player loops and timers ticking away than you need?
Reply
#4

This is a good point, I didn't think of that.
Reply
#5

A point FOR multiple timers: If you have only one timer, you will have to loop through all players, checking if they are connected. But if you create a timer per player on connection you wont have to check if he is connected every time.

But i think one timer is still faster. If you use foreach it is for sure.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)