VB6.0 毫秒级时间差

注:Visual Basic 6.0 小学级别的代码,留作笔记。

Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Command1_Click()
Dim tm1 As Long
Dim tm2 As Long
Dim tm3 As Long

tm1 = timeGetTime
Debug.Print (tm1)

Sleep 100
 
 tm2 = timeGetTime
 Debug.Print (tm2)
 
 tm3 = tm2 - tm1
Text1.Text = tm3 / 1000

End Sub

你可能感兴趣的:(VB6.0 毫秒级时间差)