有人说是sleep,在pascal中是delay
我要是程序延时5秒钟,怎么找也找不到函数,知道的告诉我!
You should use Sleep function.
The Sleep function suspends the execution of the current thread for a specified interval.
Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
dwMilliseconds
Specifies the time, in milliseconds, for which to suspend execution. A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. A value of INFINITE causes an infinite delay.
This project needs a button
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
KPD-Team 1998
URL: http://www.allapi.net/
E-Mail: KPDTeam@Allapi.net
Me.Caption = "Your system will sleep 5 sec."
Sleep for 5000 milliseconds
Sleep 5000
Me.Caption = ""
End Sub
Private Sub Form_Load()
Me.Caption = ""
Command1.Caption = "Sleep ..."
End Sub