﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2240	Strange behavior of TimerDiff	yupepa		"On some PC's (Intel Core2 Duo, E8400 3GHz) i have got strange results with timers.

{{{
$begin = TimerInit() 
Sleep(5000) 
MsgBox(0, ""Timer"", ""Duration = ""& TimerDiff($begin))
}}}

The result always differs, between 200 and 500. Same behavior with timers UDF. 

It seems that the problem is in the functions QueryPerformaceCounter and QueryPerformanceFrequency. There exists a blog concerning the problems with it: http://www.virtualdub.org/blog/pivot/entry.php?id=106

My solution:

{{{
$begin = f_timeGetTime() 
Sleep(1234) 
$end = f_timeGetTime() 
$diff = $end - $begin 
MsgBox(0, ""Timer1"", ""Diff = ""&$diff) 

Func f_timeGetTime() 
Local $aResult = DllCall(""winmm.dll"", ""long"", ""timeGetTime"") 
If @error Then Return SetError(@error, @extended, -1) 
Return $aResult[0] 
EndFunc ;==>f_timeGetTime
}}}"	Bug	closed		AutoIt	3.3.8.1	None	Wont Fix	Timers	
