[Timer Help] Score saving timer, should it always be running or should it be killed? -
Ghost100 - 07.10.2012
Hey all..
Okay so, i use ONE timer in my entire script, and it accounts for everything including saving players scores, money etc.
My timer is: SetTimer("kscore", 180000, true);
It is called every 3 minutes.
My question is, as this timer is under OnGameModeInit, i currently NEVER stop/kill it...Should it be stopped at some point? Is there a way to completely stop it, and restart it - hence reducing excess CPU usage etc.
My server is optimized to its maximum, except for this damn timer..
any help would be much appreciated.
Many thanks,
Trooper
Re: [Timer Help] Score saving timer, should it always be running or should it be killed? -
PrawkC - 07.10.2012
Having everything in one timer isn't the best idea, if you can separate it into a few.. IE one for saving data, one for round time etc.. and maybe only call the data saving one (assuming data for everyone) at the end of each round.
Re: [Timer Help] Score saving timer, should it always be running or should it be killed? -
Ghost100 - 07.10.2012
Prawkc, thats not an issue, on my public callback it saves for one player at a time...
My question is about the killtimer, and whether it should be used.
Re: [Timer Help] Score saving timer, should it always be running or should it be killed? -
PrawkC - 07.10.2012
Quote:
Originally Posted by Ghost100
Prawkc, thats not an issue, on my public callback it saves for one player at a time...
My question is about the killtimer, and whether it should be used.
|
You state you have one timer... if you kill that timer, how does round time function? unless you for some reason don't do that.
Re: [Timer Help] Score saving timer, should it always be running or should it be killed? -
ReneG - 08.10.2012
If it runs every 3 minutes, it's fine. You should only worry when the repeating interval is faster than the code in the timer can run.
Re: [Timer Help] Score saving timer, should it always be running or should it be killed? -
Ghost100 - 08.10.2012
thanks vincent, but that still doesnt awnser my question. Should it be killed at any point?
Re: [Timer Help] Score saving timer, should it always be running or should it be killed? -
ReneG - 08.10.2012
Unless you don't want the timer running then no, it shouldn't be killed at any point.