精确计算运行时间

来源:互联网 发布:淘宝合同 编辑:程序博客网 时间:2024/05/16 18:05

一个计算函数运行事件的小程序,now(),time(),format()都可以,不过好像这个TimeGetTime()API函数可以精确到1毫秒。

 

Dim t1 As Variant, t2 As Variant, t As Single
t1 = timeGetTime
Dim myPos As POS
myPos = FindColor("FFFFFF")
t2 = timeGetTime
t =( t2 - t1)/1000
Label2.Caption = t & vbCrLf & myPos.x & dh & myPos.y

原创粉丝点击