Sign in to follow this  
Followers 0
Dethredic

Do something for 20 seconds.

4 posts in this topic

Ok I want to make something that will do as many things as possible in 20 seconds.

For example I want to see how many loops I can do in 20 seconds.

Do

$count += 1

Until 20 seconds is done.

The loop can be a while wend loop as well.

I got something like this by doing

$current_time = @SEC

If $current_time > 39 Then

$end_time = $current_time - 60

Else $end_time = $current_time + 20

$count = 0

Do

Count += 1

Until @SEC = $end_time

The only problem with the above is that it is really slow.

Does anyone know how I can make this faster.

Also I will be doing more than just counting loops, so it should be easily customizable.


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$Init=TimerInit()
$Count = 0
Do
    $Count += 1
Until TimerDiff($Init) > 20000
MsgBox(0,"","Looped " & $count & " Times")

Damn, that's a lot of loops :whistle:

EDIT: Wow, it can do over 100 loops in 1 millisecond...

Edited by idusy

Share this post


Link to post
Share on other sites

Thanks man!


"Its not about the 30 inch 1080p display, or the SLI 8800 ultras, or the DDR3 memory. It's about when you turn on your PC, does it return the favor?"Math is like sex. Sure, it may give some practical results, but that is not why we do it

Share this post


Link to post
Share on other sites

Thanks man!

I'm a girl! Ha, I'm lying... God, I'm bored...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0