Modify ↓
#1276 closed Bug (Fixed)
_TicksToTime() displayed seconds increment at wrong time
| Reported by: | Andrew | Owned by: | Valik |
|---|---|---|---|
| Milestone: | 3.3.1.6 | Component: | AutoIt |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | _TicksToTime | Cc: |
Description
In the _TicksToTime function the value for Seconds is derived by this line...
$iSecs = Round(Mod($iTicks, 60))
causing the displayed seconds to increment at 500 ms. I believe the code should be...
$iSecs = Int(Mod($iTicks, 60))
so seconds only increments at 1000 ms (like a normal clock).
Attachments (0)
Change History (3)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
| Milestone: | → 3.3.1.6 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [5376] in version: 3.3.1.6
comment:3 by , 16 years ago
Demonstration script:
#include <Date.au3>
Local Const $nHour = @HOUR, $nMinute = @MIN, $nSeconds = @SEC
Local Const $nTicksStart = _TimeToTicks($nHour, $nMinute, $nSeconds)
Local Const $nTicksEnd = _TimeToTicks($nHour, $nMinute, $nSeconds + 1)
For $nTicks = $nTicksStart To $nTicksEnd - 1
Local $nHourNew, $nMinuteNew, $nSecondsNew
_TicksToTime($nTicks, $nHourNew, $nMinuteNew, $nSecondsNew)
If $nSeconds <> $nSecondsNew Then
ConsoleWrite("Variation starts at: " & $nTicks - $nTicksStart & @CRLF)
Exit
EndIf
Next
ConsoleWrite("No variation." & @CRLF)
Note:
See TracTickets
for help on using tickets.

On closer inspection, there is another "Round" at the beginning of the function which determines the rounding for the rest of the function.
The original function...
Should be changed to...
The function should then behave like a normal clock. Seconds should change only on 1000 ms (not at 500 ms). ie. 999 ms will display 0 sec (as is does on every other clock).