billziss-gh / EnergyBar

Supercharge your Mac's Touch Bar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The clock is one minute back

alexvan opened this issue · comments

Version 1.3

Also suffering this issue. Version 1.2.

I have never seen this and therefore I can only speculate on the reason. How often does this happen for you?

I can see two possibilities:

  • Time on macOS is counted as a floating point number, which is inherently imprecise. So for example, the time 12:15:00 may be represented internally as 12:14:59.mmm....
  • The timer is synchronized to start at the minute start (12:15:00), but for some reason it fires just before the real minute change, again resulting in reading the time as 12:14:59.mmm....

My fix would be to add some time (e.g. 10 seconds) and then throw away the seconds part, effectively rounding to the closest minute.

(Or perhaps I have done something daft in the clock and the real answer is not so complicated.)

It's consistently back. Seems being about 30 seconds back.

Turns out that the timers were firing correctly and the time was computed correctly. The problem was that the ClockWidget label would not update in certain situations.

I believe commit 9814ada should fix this. It will be available in version 1.3.

EnergyBar version 1.3 is out and I believe that it fixes this issue. Let me know if you see otherwise.