'个人认为这样是最好的………… '两大优点:1、够准确(精确可能用不上);2、占用CPU绝对小! Dim nt As Single: nt = Timer While Timer - nt < 5 Sleep 1: DoEvents Wend MsgBox "5 sec passed!"
记得好象有个等待API函数 不过忘了叫什么了===没说.......
Public Declare Function WaitCommEvent Lib "kernel32" Alias "WaitCommEvent" (ByVal hFile As Long, lpEvtMask As Long, lpOverlapped As OVERLAPPED) As Long 对吗?看看
'两大优点:1、够准确(精确可能用不上);2、占用CPU绝对小!
Dim nt As Single: nt = Timer
While Timer - nt < 5
Sleep 1: DoEvents
Wend
MsgBox "5 sec passed!"
对吗?看看