﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1082	TimerDiff results in negative values and resets.	Zoster		"I'm getting strange results from TimerDiff in the following setup:

{{{
Global $gt_TimerLastAction = TimerInit()

While True
	_SomeFunc1()
	_SomeFunc2()
	_TimerTest()
	Sleep(100)
WEnd

Func _TimerTest()
	$t_TimerDiff = TimerDiff($gt_TimerLastAction)
		Switch $t_TimerDiff
			Case 0 to 45000
				;Wait aleast 45sec
				ConsoleWrite(""Still under 45sec: "" & $t_TimerDiff & @CRLF)
				Return
			Case 45001 to 99000
				;Do action
				ConsoleWrite(""Action: ""& $t_TimerDiff & @CRLF)
				$gt_TimerLastAction = TimerInit()
				Return
			Case Else
				;Action overdue, reset
				ConsoleWrite(""Overdue:"" & $t_TimerDiff & @CRLF)
				$gt_TimerLastAction = TimerInit()
				Return
		EndSwitch
EndFunc
}}}

The first call produces a negative diff of -1864.62581138106.
In between the diff sometimes gets reduced from eg 14028.177324213 to 9461.37763319081 (between two case 45001) and some negative values also appear from time to time.

The variable is not being reset anywhere else in the program.

As far as I understand the TimerDiff function a negative value should be impossible.
Might this be a variant conversion problem or can the timer be reset anywhere else?

The application runs with AutoIt 3.3 on WinXP SP3 (Ger). It also uses some CommPort UDF (CommMG) and is remote controlled via Dameware.




"	Bug	closed		AutoIt	3.3.0.0	None	Works For Me	timerdiff negative values	
