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 Changed 15 years ago by Andrew
comment:2 Changed 15 years ago by Valik
- Milestone set to 3.3.1.6
- Owner set to Valik
- Resolution set to Fixed
- Status changed from new to closed
Fixed by revision [5376] in version: 3.3.1.6
comment:3 Changed 15 years ago by Valik
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)
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.
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).