2 ms·
That looks like a well thought out and engineered approach to handle time. Often it left unspecified what happens when time warps. And there a certainly a lot o
by rdtsc 12y ago
That looks like a well thought out and engineered approach to handle time. Often it left unspecified what happens when time warps. And there a certainly a lot of interesting corner cases.
I've seen system misbehave very badly during time warps. Even if NTP is configured sometimes it will snap the time instead of slewing it.
It is always fun when there is a time delta measurement on absolute time and it moves backwards. Now dt is negative with all kind of wonderful and exciting ramifications "Oh so we are sleeping for 4294967294 seconds, great!"
- TheLoneWolfling 12y agoThis is why most things along those lines (timers, etc) should be based on number of ticks since a reference point. Or, alternatively, a signed value (where there is a buffer zone near wrap that errors.) Not that that doesn't have problems of its own.
- jlouis 12y agoThis is essentially what will be possible now, with a 'CHANGE' event if the underlying clock suddenly warps/jumps to a new point in time. Your code has to be "time warp safe" in that it needs to handle this. Interestingly, most Erlang code will be because most systems will just call erlang:monotonic_time(), leaving the other calls for time-affected applications, which are rarely that many.