Jump to content

Quick question about Sleep


Recommended Posts

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...