Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 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 Changed 10 years ago by Jos

  • Resolution set to No Bug
  • Status changed from new to closed

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

comment:2 follow-up: Changed 10 years ago by anonymous

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

comment:3 in reply to: ↑ 2 ; follow-up: Changed 10 years ago by Jos

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.

comment:4 in reply to: ↑ 3 Changed 10 years ago by anonymous

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 Changed 10 years ago by mvg

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.