Dim tim '没有定义成全局变量
Private Sub Timer1_Timer()
tim = tim + 1
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Timer1.Enabled = True
Do
DoEvents
LngTmp = LngTmp + 1
If LngTmp = 5000 Then Exit Do
Loop
MsgBox "time=" + Str(tim) + "ms", , "Time"
tim = 0
End Sub