【VBA】测试程序运行时间,延时方法

测试程序运行时间

    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
上一篇:[转]maven全局配置文件settings.xml详解


下一篇:(一)GPIO 编程实验 LED 流水灯控制