26.12.2014, 22:02
Quote:
I'd like to bump this, if I may. Is there anybody out there with a good idea of how to guage the effects of timers on CPU usage?
|
When i was new to scripting people always told me the same misconception that timers are bad, they cause high cpu issues, use as few timers as possible, and i had tons of code that was extremely slow under one timer. And wouldn't you know, my server used a decent amount of cpu usage per player cause it was running everything at once. I then used more timers splitting things up, and guess what, my cpu issues were gone and the server even had better sync and less issues with timeouts.
So from my own experience, the entire misconception about timers is quite wrong. Watch what your calling with each timer and make sure the code that is being executed by each timer isn't massive loops inside more loops that have another while loop......you should know where i'm trying to get at. The same goes for onplayerupdate.