今天再测试了一下,在我的电脑上 lowxiong 的代码比我的代码快 7 毫秒左右。
测试方法:
去掉 显示部分,然后其它不变,循环调用 100次,然后看最后的计时。
测试方法:
去掉 显示部分,然后其它不变,循环调用 100次,然后看最后的计时。
程序代码:
Dim t1 As Long, t2 As Long Dim t3 As Long, t4 As Long Dim i As Long t1 = timeGetTime For i = 1 To 100 Cls Call Command1_Click Next i t2 = timeGetTime For i = 1 To 100 DoEvents Next i t3 = timeGetTime For i = 1 To 100 Cls Call Command2_Click Next i t4 = timeGetTime For i = 1 To 100 DoEvents Next i Cls Print "1"; t1; t2, t2 - t1 Print "2"; t3; t4, t4 - t3
授人于鱼,不如授人于渔
早已停用QQ了