26.09.2010, 10:33
(
Последний раз редактировалось LarzI; 30.09.2010 в 09:58.
)
Fast One-Second-Timer
Credits: See pastebin linkWhat 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
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
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!