3 ms·
This looks like an answer to my question I posted elsewhere under this story. (Namely, how do I get egg-timer elapsed time since a certain UTC time? Which, the
by Scramblejams 13y ago
This looks like an answer to my question I posted elsewhere under this story. (Namely, how do I get egg-timer elapsed time since a certain UTC time? Which, the UTC component isn't a must have for me, the Unix Epoch will work just as well.)
But I notice that your solution is POSIX only. How about Windows?
And how do NTP adjustments affect this solution -- surely when the NTP server tells you your system clock is consistently off by 16%, there's got to be some effect on clock_gettime with CLOCK_MONOTONIC, right? I'd like to retain the ability to use NTP to improve the accuracy of the results.
- cmccabe 13y agoCLOCK_MONOTONIC is affected by NTP on Linux, at least. UNIX time is not actually seconds since the epoch. It's just something very, very close. There are a few cases where the same time_t value repeats for two seconds in order to insert a leap second. With regard to Windows, I assume there are equivalents to all these interfaces, but I don't know what they are.