← Back to context

Comment by jcelerier

1 year ago

51 days * 86400 seconds * 1000

=> 4406400000

2^32

=> 4294967296

the coincidence seems unlikely, it's basically ~~5 hours and a half~~ 30 hours of difference if one has a 1-ms counter increment

It's a day and a half difference, and since 2^32 is the smaller number that would be pretty catastrophic. Pretty likely it's coincidence.

Where did you get 5 hours and a half? It seems to be closer to 31 hours:

    >>> round((4406400000 - 2**32)/(1000 * 3600), 3)
    30.954

Not getting it.. yeah the famous 32 bit ms overflow after 49 something days. But why then 51 here? Shouldn't they be required to reboot after 49 days please please? :D

  • Possibly cumulative error in the timing source?

    • It's possible to run tasks instead of starting every second, starting one second after the previous iteration finishes.

      So if you have something that checks the system health every millisecond, and keeps a count instead of a duration, then if it takes a couple microseconds to complete you might get something less than 86 million ticks per day instead of 86.4 million.

      2 replies →

    • Or just ticking every 1.025 ms (e.g. at 975 Hz instead of 1khz)... that brings us to :

          (4406400000 - 1.025*2 ^ 32)/1000 
      

      so a difference of 1.12 hours with the "51 days" mention.