Jump to content

sleep in minutes?


Ashww
 Share

Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

why Sleep with parameters from 1 through 10 always sleeps 10 milliseconds.

im not sure but uhh yeah it may depend on the computer resources like what was already said earlier.... but i dont know lol is it ACTUALLY 10ms EVERY SINGLE time on EVERY Computer, i have no time to test this out.
Link to comment
Share on other sites

im not sure but uhh yeah it may depend on the computer resources like what was already said earlier.... but i dont know lol is it ACTUALLY 10ms EVERY SINGLE time on EVERY Computer, i have no time to test this out.

You don't need to do any lengthy test, simply run this code, you will see that the first is around 10ms while the second will be around 100. I can confirm this on both single- and multi-core systems.

$Timer = TimerInit()
Sleep(10)
ConsoleWrite("One 10ms sleep=" & TimerDiff($Timer) & @CRLF)

$Timer = TimerInit()
For $X = 1 To 10
    Sleep(1)
Next
ConsoleWrite("Ten 1ms sleep=" & TimerDiff($Timer) & @CRLF)
Link to comment
Share on other sites

So, that change was made in 2007... here are posts that "worried" about sleep before that. They have several methods of seeing how "sleeps" and "sleep UDFs" perform - and questions about types of loops:

http://www.autoitscript.com/forum/index.php?showtopic=13415

http://www.autoitscript.com/forum/index.php?showtopic=13335

http://www.autoitscript.com/forum/index.php?showtopic=13605

Culminating in a sleep UDF from 2005

http://www.autoitscript.com/forum/index.php?showtopic=13834

Well, it is about time that someone brought this up again.

I'll never be able to sleep until this is settled. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

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...