菜鸟发问,如何获得事件的运算时间
比如想知道加法一百次运算的时间,如何做计时器自动计时
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Pause(ByVal sSec As Long)
Dim StartSec As Long
StartSec = GetTickCount()
While (GetTickCount() - StartSec) / 1000 < sSec
DoEvents
Wend
End Sub
Private Sub Command1_Click()
MsgBox "开始"
t = Timer
Pause 2
MsgBox Timer - t & "秒"
End Sub