mIRC Home    About    Download    Register    News    Help

Print Thread
#177729 30/05/07 11:21 AM
Joined: May 2007
Posts: 2
B
BreakIt Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
B
Joined: May 2007
Posts: 2
Just wondering if there is any limit to how many timers can be run at the same time.

With a script that I've just made there could be a few thousand timers going at once.

BreakIt #177730 30/05/07 11:35 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I believe the number of timers is only limited by the your computer's available memory. However, if you are going to have that many timers, perhaps you should consider another method that would be more efficient. Without seeing your code, it sounds as though having that many timers is only because the code isn't very efficient.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #177731 30/05/07 11:44 AM
Joined: May 2007
Posts: 2
B
BreakIt Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
B
Joined: May 2007
Posts: 2
The timers have to do with users getting kicked, an automated blacklist, many users and my lazyness. (No, this is not something I can use ban -u for.)

Anyway, thanks for your post.

BreakIt #177762 30/05/07 11:24 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Just a note that you may find useful...

Without too much difficulty, you could set up a single timer that triggers every minute or 5 minutes or whatever you want and, at that time, it deals with whatever your current timers deal with.

Example:
If you have your own unban timers rather than ban -u, as you commented on, rather than starting a timer every time, you could add the information to a hash table, INI file, or TXT file. Then, a single timer would trigger every minute or however often you prefer and would check the stored location (hash/INI/TXT) for anything that is marked within a certain time frame and unban them. You may not have the unbans happening at exactly XX seconds (unless your single timer is triggering every second), but it really doesn't have to for something like that.

Anyhow, it's just a possible way to prevent thousands of timers. Whether it ends up being faster or slower, I can't say. And you also would want to consider the memory usage with thousands of timers versus only one. It may not be what you'd like to do. I just thought I'd offer you an example of how you can change how you handle things in order to cut down on your timers.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard