Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: FarisDon on Jan 26, 2016, 07:26 PM

Title: Meh, The Timers!
Post by: FarisDon on Jan 26, 2016, 07:26 PM
Hey, Folks! Well, i just simply wanna ask do timers lag?
Suppose that i'm using just a simple timer to check a player every minute, or just showing a announcement continuously, until he is in the server, and then, he use many timers suddenly like, for repairing, for gotoloc, all together, so will it make the server or the player LAG? and is their anyway to get rid of it ; obviously removing the timers but something else?
Sorry, Folks, i'm continuously, asking questions, cause i've made an script, but i can't assure myself that about lagging stuff.
P.S: Sorry, for my bad english : [.
Title: Re: Meh, The Timers!
Post by: Thijn on Jan 26, 2016, 07:32 PM
Timers will, just as any other part of your code, lag if the code that's executed takes a long time. Doing database queries, doing long loops, stuff like that takes a while and will halt any other code until it completes.
Title: Re: Meh, The Timers!
Post by: Stormeus on Jan 26, 2016, 09:57 PM
http://viceunderdogs.com/index.php?topic=4452.msg53177#msg53177
Title: Re: Meh, The Timers!
Post by: . on Jan 27, 2016, 02:22 AM
It's understandable to see how people would tend to think timers suck at performance. But in reality it's not the timers that are poorly optimized. Your code is the one that is a total mess (don't argue with me son. I've seen code that makes boogie man piss himself). But since you're not able to see that and eager to guilt something. The obvious guilt falls to the timers. Because why not.