函数参考


TimerInit

返回一个可以给TimerDiff()函数使用的句柄,用于计算经过的毫秒数.

TimerInit ( )

参数

None.

返回值

返回一个可以给TimerDiff()函数使用的句柄,用于计算经过的毫秒数.

注意/说明

The return value from TimerInit() should be treated as an opaque handle and should only be used to pass to TimerDiff(). Any other usage of the return value is a potential error.

相关

TimerDiff

示例/演示


Local $hTimer = TimerInit() ; Begin the timer and store the handle in a variable.
Sleep(3000) ; Sleep for 3 seconds.
Local $iDiff = TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit. The variable we stored the TimerInit handlem is passed as the "handle" to TimerDiff.
MsgBox(4096,"时间差,这个计时的精度比sleep高",$iDiff)