在程序流程中经常要延时一段时间后再继续往下执行,同时你也可以接着处理其他的事务。
延时代码:
Public Sub Wait(ByVal WaitTime As Single, Optional ByVal vDoEvents As Boolean = True)
Dim StartTime As Double
StartTime = Timer
Do While Timer < StartTime + WaitTime
If Timer > 86395 or Timer = 0 Then Exit Do
If vDoEvents Then
DoEvents
End If
Loop
End Sub
附件下载:
点击下载此附件
演 示: