ID:160769
 
I've ran a profile on Dream Daemon to try and find some lag causing procs, and Stat is on top of all with:

Self CPU: 20.702
Total CPU: 20.702
Real Time: 20.700
Calls: 1541

This is just a 20 second run. Is it normal? For such a short period of time it looks like it's taking a lot of CPU. Is there any way of maybe reducing the update frequency without using tick_lag?

Any help is appreciated.
Well, I don't know if that insane amount of CPU usage is normal, but it calls every second/tick (the DM reference doesn't specifiy), so yes, I guess that is normal depending on the number of clients within your game. You can decrease the frequency of the calls by sleeping at the end, like the reference says!*


Straight from the reference \/
"If this procedure sleeps (or engages in some other waiting operation), it will not be called again until it finally returns"


*If you're wondering, that was to get you to read the reference before you post :P
In response to Jeff8500
Lol. I did read, but it said if i wanted to delay I would have to change tick_lag..o.o I use 'Help On' on Dream Maker that's what it told me. but I'll try sleeping it. Thanks!
In response to Ruben7
I used the help on Dream Maker, too. It's the same as the reference. Remember to read the entire thing, only the bottom states the lowering the tick_lag increases the frequency.
In response to Jeff8500
It's soooooo much text though sadface. I will next time =D
What exactly are you doing inside of Stat()? It's not normal for it to take that much to operate. You may be doing some kind of extra stuff inside of Stat(). You should also remember to enclose your statpanel() calls inside of if() statements -- makes it only update panels if they have focus.