测试程序运行时间
Dim start As Date
start = Now()
Dim i As Long
For i = 0 To 10000000 ' 10 million Next Debug.Print "ApiCall Elapsed: " & Format(Now() - start, "HH:mm:ss")
延时方法:
Sub delay(T As Single)
Dim T1 As Single
T1 = Timer
Do
DoEvents
Loop While Timer - T1 < T
End Sub
Sub subDalay()
MsgBox "开始"
'延时3秒
delay (3)
MsgBox "结束"
End Sub