2 ms·
You never do this sort of conversion manually. On linux you can use clock_gettime() with CLOCK_TAI: CLOCK_TAI (since Linux 3.10; Linux-specific)
by mytailorisrich 2y ago
You never do this sort of conversion manually.
On linux you can use clock_gettime() with CLOCK_TAI:
CLOCK_TAI (since Linux 3.10; Linux-specific)
A nonsettable system-wide clock derived from wall-clock time
but ignoring leap seconds. This clock does not experience
discontinuities and backwards jumps caused by NTP inserting
leap seconds as CLOCK_REALTIME does.
The acronym TAI refers to International Atomic Time.
Now, leap seconds are advertised in advance and your system know when they occur through a leap seconds file (leap-seconds.list) that needs to be kept up to date.
- globular-toast 2y agoAh, thanks. I didn't think it sounded like something to do in application code.