Friday, September 26, 2008

Win 32 API Sleep

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

No comments:

Just Answer


JustAnswer.com