Dim timeStart As DatePrivate Sub Form_Load()
TimerStart = Now()
End SubPrivate Sub Timer_Timer()
labTime = DateDiff("h", timeStart, Now()) & "小时" & Str$(DateDiff("n", Timerstart, Now()) Mod 60) & "分" & Str$(DateDiff("s", Timer1, Now()) Mod 60) & "秒"
End Sub
我发现时间竟然不准确呀。秒还可以了,分就错差很大,大概56秒就跳1分。
怎么回事呢?
难道只能将秒换算成分才成?
TimerStart = Now()
End SubPrivate Sub Timer_Timer()
labTime = DateDiff("h", timeStart, Now()) & "小时" & Str$(DateDiff("n", Timerstart, Now()) Mod 60) & "分" & Str$(DateDiff("s", Timer1, Now()) Mod 60) & "秒"
End Sub
我发现时间竟然不准确呀。秒还可以了,分就错差很大,大概56秒就跳1分。
怎么回事呢?
难道只能将秒换算成分才成?
用API timesetevent,timekillevent
http://expert.csdn.net/Expert/topic/2523/2523006.xml?temp=.321438
这个timer1???
GetTickCount 函数返回系统启动后经历的毫秒数。它受系统时钟精度的限制。如果需要高精度的时钟,请采用 amultimedia timer 或 high-resolution timer。 DWORD GetTickCount(VOID)
参数
该函数无参数。 返回值
返回值是系统启动后经历的毫秒数。注:
下表列出了系统时钟的分辩率:系统分辩率
Windows NT 3.5 及以上 系统时钟运行精度约 10ms.
Windows NT 3.1 系统时钟运行精度约 16ms.
Windows 95 及以上 系统时钟运行精度约 55ms.