#1799 closed Bug (No Bug)
Result from TimerInit is wrong?
| Reported by: | 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 , 15 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
follow-up: 3 comment:2 by , 15 years ago
ok; a function returns to a wrong value! I think this is a bug of this function or mistake in manual !!!
follow-up: 4 comment:3 by , 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.
comment:4 by , 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 , 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.

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