# GetTickCount的使用Sample

Posted by 四眼蟾蜍 on July 12, 1999 at 20:04:34:

In Reply to: 有关GetTickCount的使用...请各位高手帮帮忙...谢谢..(^_^) posted by Hiei on July 02, 1999 at 13:06:24:

Public Declare Function GetTickCount Lib "kernel32" () As Long

Private Sub DelayAwhile(Optional MultiTimes As Integer = 1)
Dim nowtimer&
If MultiTimes < 1 Then MultiTimes = 1
If MultiTimes > 10 Then MultiTimes = 10
nowtimer& = GetTickCount()
Do
' DoEvents
Loop Until GetTickCount() - nowtimer& >= DelayTime * MultiTimes

End Sub

使用Sample:
Private Sub FrushComm()
Do
DoEvents
Loop Until Comm1.OutBufferCount = 0
DelayAwhile (2)
End Sub

Follow Ups: