Sleep Function

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Platforms: Win 32s, Win 95/98, Win NT

Sleep pauses program execution for a certain amount of time. This is more accurate than using a do-nothing loop, waiting for a certain amount of time to pass. The function does not return a value.

dwMilliseconds
The number of milliseconds to halt program execution for.

Example:

' Pause the program for 2 seconds, displaying the system
' time before and after the pause.

Debug.Print "The time is "; Time$  ' display the current time
Sleep 2000  ' 2000 milliseconds = 2 seconds to delay
Debug.Print "The time is "; Time$  ' this time will be 2 seconds later

Category: Other
Back to the index.


Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/api/s/sleep.html