Modify

Opened 15 years ago

Closed 14 years ago

#2008 closed Bug (No Bug)

timerinit does not return int, returns imprecise float, differences bad

Reported by: jmichae3@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

$a=int(TimerInit()) ;for some reason, timerinit returns a float rather than an int! very imprecise!!!
sleep(100)
$b=int(timerinit())
$c=$b-$a ;should be about 100, but result is always about 297 million to 299 million
MSGBOX(0,"TIMERINIT",$a&","&$b&","&$c)

I need an int. floats are useless to me. floats lose precision and are very imprecise (floating point error for instance).

I know there is a timerdiff for doing time differences, but timerdiff returns also a useless float, not a useful int.

I need an accurate result from timerinit if I am going to use it in my time calculations. please fix. thanks.

when using int() to wrap the timerinit function and do subtractions, should be about 100, but result is always about 297 million to 299 million.

Attachments (0)

Change History (4)

comment:1 by mvg, 15 years ago

Your barking up the wrong tree. See creators of your OS.
And study the timer related pages at MSDN while your at it.

comment:2 by mvg, 15 years ago

Bummer ...

BOOL WINAPI QueryPerformanceCounter(
  __out  LARGE_INTEGER *lpPerformanceCount
);

Or (also) see _Timer_Init()
?

(_Timer_Init() no match(speed) compared to TimerInit().)

comment:3 by Beege, 15 years ago

Are you listening to what your saying? How could a int returned be more accurate than a float? Your example uses timerinit() wrong so its kinda irrelevant.

$a=TimerInit();
sleep(100)
$b=TimerDiff($a)

$b = 99.3337961739871 on mine.

comment:4 by Valik, 14 years ago

Resolution: No Bug
Status: newclosed

I'm not sure where you got your assumptions but they are flat out wrong. You cannot do what you are doing and expect to get meaningful values back. There is more to TimerDiff() than an internal call to TimerInit() to get a new timestamp and a simple subtraction. I suggest you use functions as documented or learn what the fuck you're talking about before wasting my time again.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.