Perintah WIndows API untuk membuat Sleep pada Komputer

Tuesday, May 31, 2011 | 11:29 AM|


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

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

dwMilliseconds
The number of milliseconds to halt program execution for.

Kode :

' 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

0 comments: