This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients belopolsky, jab, ned.deily, njs, nooB, p-ganssle, ronaldoussoren, vstinner, xrisk
Date 2020-08-06.09:45:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596707137.05.0.511103967122.issue41303@roundup.psfhosted.org>
In-reply-to
Content
> 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*.
History
Date User Action Args
2020-08-06 09:45:37vstinnersetrecipients: + vstinner, ronaldoussoren, belopolsky, ned.deily, njs, jab, nooB, p-ganssle, xrisk
2020-08-06 09:45:37vstinnersetmessageid: <1596707137.05.0.511103967122.issue41303@roundup.psfhosted.org>
2020-08-06 09:45:37vstinnerlinkissue41303 messages
2020-08-06 09:45:36vstinnercreate