[Timer Help] Score saving timer, should it always be running or should it be killed?
#1

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
Reply
#2

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.
Reply
#3

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.
Reply
#4

Quote:
Originally Posted by Ghost100
View Post
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.
Reply
#5

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.
Reply
#6

thanks vincent, but that still doesnt awnser my question. Should it be killed at any point?
Reply
#7

Unless you don't want the timer running then no, it shouldn't be killed at any point.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)