Sign in to follow this  
Followers 0
jessegk

Quick question about Sleep

4 posts in this topic

Say I have $Variable = 1000

How would I format Sleep so that it uses the variable.

So instead of going:

Sleep (1000)

it would be something like:

Sleep ($Variable)

You know what I mean.

Thanks.

Share this post


Link to post
Share on other sites



Yes it's right. Just it it for yoursself:

$i = 3000
consolewrite(1)
Sleep($i)
consolewrite(2)
Thanks for the reply. It worked fine. I guess I had a typo or something somewhere when I tried this earlier.

Again, thanks!

Share this post


Link to post
Share on other sites

I also have used it with a multiplier to compensate for slower machines

For instance througout the prog I might need different Sleep times:

Instance A: Sleep(1000) 1 sec

Instance B: Sleep(2000) 2 sec

Instance C: Sleep(3000) 3 sec

If I want a user to be able to select his machine speed and it propagate throughout the program differently in different places, but yet proportionally I do this:

$M = 'Get this from the user-- ie: InputBox (Maybe store it in registry for later) maybe give a choice of 1 to 10, 10 being slowest

Then:

Instance A: Sleep(1000 * $M)

Instance B: Sleep(2000 * $M)

Instance C: Sleep(3000 * $M)

Now If $M = 4 Then

Instance A: Sleep(1000 * $M) is 4 sec

Instance B: Sleep(2000 * $M) is 8 sec

Instance C: Sleep(3000 * $M) is 12 sec

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