Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually, this sort-of describes "smeared UTC", which is used by some computer systems such as Google's NTP servers: https://developers.google.com/time/smear

POSIX time does not generally work that way. It may seem that way for 1-second resolution timestamps, but at higher resolutions (say millisecond resolution), the clock does not completely stop. It keeps going, jumps backward 1 second, then continues.



I think you're talking about struct timespec, I'm talking about time_t.

I don't think "POSIX time" specifies behavior during leap-seconds for the functions that return timespecs (gettimeofday() [0] and clock_gettime(CLOCK_REALTIME) [1]), so any behaviour would be valid - including smearing or repeating nanoseconds?

[0] https://pubs.opengroup.org/onlinepubs/9699919799/functions/g...

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/c...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: