Message374923
> On macOS CLOCK_UPTIME_RAW is the same as mach_absolute_time (according to the manpage).
https://developer.apple.com/documentation/kernel/1462446-mach_absolute_time says:
"mach_absolute_time: Returns current value of a clock that increments monotonically in tick units (starting at an arbitrary point), this clock does not increment while the system is asleep."
"Discussion: Prefer to use the equivalent clock_gettime_nsec_np(CLOCK_UPTIME_RAW) in nanoseconds."
where clock_gettime_nsec_np() is: "As a non-portable extension, the clock_gettime_nsec_np() function will return the clock value in 64-bit nanoseconds."
It doesn't say anything about NTP, whereas CLOCK_MONOTONIC_RAW seems to a clock which is not adjusted by NTP:
"""
CLOCK_MONOTONIC_RAW
clock that increments monotonically, tracking the time
since an arbitrary point like CLOCK_MONOTONIC. How-
ever, this clock is unaffected by frequency or time
adjustments. It should not be compared to other
system time sources.
"""
So right, it sounds like mach_absolute_time() returns *seconds*. |
|
Date |
User |
Action |
Args |
2020-08-06 09:45:37 | vstinner | set | recipients:
+ vstinner, ronaldoussoren, belopolsky, ned.deily, njs, jab, nooB, p-ganssle, xrisk |
2020-08-06 09:45:37 | vstinner | set | messageid: <1596707137.05.0.511103967122.issue41303@roundup.psfhosted.org> |
2020-08-06 09:45:37 | vstinner | link | issue41303 messages |
2020-08-06 09:45:36 | vstinner | create | |
|