by crazygringo · 7y ago · 0 comments
I'll confess that testing that my software works while a user (or daemon) changes the system clock is something that I don't think has ever occurred to me, and now I'm wondering what other edge cases also haven't occurred to me.
What is a realistic code example that might have problems with system clock updates?
But as long as you only need to track time for dealing with time intervals in an abstract fashion, you can get away with a nice continuous and monotonous scalar representation of timestamps.
There is plenty of code that has problems with time shifts, simply look at how often software crashes or misbehaves when there are leapseconds. Cloudflare experiences some of their code crashing because over a leap second, the time a request took suddenly became negative.