Closed mathewsb closed 4 years ago
This pulls over the timer fix from AudereNow/audere#666.
Around each minute boundary, the timer has a wonky behavior where it temporarily shows a time like "3:60".
This happens because the current minute is calculated using Math.floor(), while the current second is calculated using Math.round().
Math.floor()
Math.round()
I fixed this by first converting to an integer number of seconds. Then the remaining calculations are more straightforward.
I decided to use Math.ceil() here so that the timer has this sequence:
Math.ceil()
10:00 -> 9:59 -> ... -> 0:02 -> 0:01 -> DONE!
rather than:
9:59 -> 9:58 -> ... -> 0:01 -> 0:00 -> DONE!
This pulls over the timer fix from AudereNow/audere#666.
Around each minute boundary, the timer has a wonky behavior where it temporarily shows a time like "3:60".
This happens because the current minute is calculated using
Math.floor()
, while the current second is calculated usingMath.round()
.I fixed this by first converting to an integer number of seconds. Then the remaining calculations are more straightforward.
I decided to use
Math.ceil()
here so that the timer has this sequence:rather than: