[FilterScript] Fast One-Second-Timer
#1

Fast One-Second-Timer
Credits: See pastebin link

What does it do?

Basically, I made a tiny script for one-second-timers.
It is very useful for eg. countdowns and similar stuff, because it's faster than just looping a timer each "millisecond".

How can you prove that this is actually faster?

Easy.

By using this line - SetTimer("OneSecTimer", 1000, true);
I got this output for 10 seconds:

Код:
[12:29:47] 1 - Ticks: 1092
[12:29:48] 2 - Ticks: 1090
[12:29:49] 3 - Ticks: 1090
[12:29:50] 4 - Ticks: 1080
[12:29:51] 5 - Ticks: 1100
[12:29:52] 6 - Ticks: 1090
[12:29:54] 7 - Ticks: 1080
[12:29:55] 8 - Ticks: 1085
[12:29:56] 9 - Ticks: 1085
[12:29:57] 10 - Ticks: 1095
And as you can see, it even skips a second, so this takes about 11 seconds
But with my easy script, I got this output:

Код:
[11:00:11] 1 - Ticks: 1002
[11:00:12] 2 - Ticks: 1002
[11:00:13] 3 - Ticks: 1002
[11:00:14] 4 - Ticks: 1001
[11:00:15] 5 - Ticks: 1001
[11:00:16] 6 - Ticks: 1001
[11:00:17] 7 - Ticks: 1001
[11:00:18] 8 - Ticks: 1002
[11:00:19] 9 - Ticks: 1002
[11:00:20] 10 - Ticks: 1002
About 80 less milliseconds for "each second", and it doesn't skip any seconds.

How can I take advantage of this script?
Well, basically, you just edit the piece of code inside the tickcount check.
I thought about just posting this up in Script Tutorials, since this isn't really such a big script, and you have to edit it for your usage, but I figured out it probably fitted better in here.. Idk.

Download:

Pastebin: - ***
UPDATE
Pastebin: - http://pastebin.com/925qYdxw

And if you wanted to see the script for the first output, here it is:
http://pastebin.com/4yDsR2UW

ENJOY!
Reply


Messages In This Thread
Fast One-Second-Timer - by LarzI - 26.09.2010, 10:33
Re: Fast One-Second-Timer - by Mauzen - 26.09.2010, 10:41
Re: Fast One-Second-Timer - by Kyosaur - 26.09.2010, 10:42
Re: Fast One-Second-Timer - by LarzI - 26.09.2010, 10:48
Re: Fast One-Second-Timer - by Kyosaur - 26.09.2010, 11:09
Re: Fast One-Second-Timer - by LarzI - 26.09.2010, 11:19
Re: Fast One-Second-Timer - by YmOn - 30.09.2010, 06:19
Re: Fast One-Second-Timer - by LarzI - 30.09.2010, 07:16
Re: Fast One-Second-Timer - by Slice - 30.09.2010, 08:55
Re: Fast One-Second-Timer - by LarzI - 30.09.2010, 09:09

Forum Jump:


Users browsing this thread: 4 Guest(s)