Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1799 closed Bug (No Bug)

Result from TimerInit is wrong?

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

Description

Hi,

a short question concerning the TimerInit and TimerDiff functions -
both propose in online manual to return a value in milliseconds:

TimerInit: Returns a timestamp number (in milliseconds)
TimerDiff: Returns the time difference (in milliseconds) from a previous call to TimerInit().

But what will happen, if you try to calculate the difference between two TimerInit-calls:

$begin=TimerInit()
sleep(3000)
$diff=TimerDiff($begin)
$ende=TimerInit()

msgbox(0,"",$begin & @CR & $ende & @CR & $diff & @CR & $ende-$begin)

As Result I got for example:

627128492751499 #$begin
627137430825446 #$ende
2987.xxxx #$diff
8938073947 #$ende-$begin

So my question: what's the unit I get from TimerInit as the difference between $ende and $begin does not match to $diff???

Attachments (0)

Change History (5)

comment:1 by Jos, 15 years ago

Resolution: No Bug
Status: newclosed

NO Bug: Questions must be asked in our forum, This is for reporting bugs.

comment:2 by anonymous, 15 years ago

ok; a function returns to a wrong value! I think this is a bug of this function or mistake in manual !!!

in reply to:  2 ; comment:3 by Jos, 15 years ago

Replying to anonymous:

ok; a function returns to a wrong value! I think this is a bug of this function or mistake in manual !!!

Don't see how this can be true as TimerInit() and TimerDiff() work fine.

in reply to:  3 comment:4 by anonymous, 15 years ago

Don't see how this can be true as TimerInit() and TimerDiff() work fine.

Hi Jos,

thanks for your reply, but in the given example, it's clearly visible that TimerInit() returns a type of timestamp, but what is the base of this value? The manual says, it should be in milliseconds, but thats not true, as you see a factor of around 3e6 between their difference and the result of TimerDiff(). Is this factor a constant value on each system or would it depend from CPU-frequency or something else?

Kind regards, Daniel

comment:5 by mvg, 15 years ago

PS:
TimerInit doc says: "Returns a timestamp number (in milliseconds)."

"(in milliseconds)" is wrong.

I'm not sure what it returns, but it seems system depending. so probably cpu ticks or something to that effect.

@OP: Check the "timer management" UDF and ask in forum if you run into problem.

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.