Closed brandon-leapyear closed 5 years ago
@brandon-leapyear do I understand correctly that this means MonotonicRaw
is now available on Mac
and no longer Linux
-specific? If yes, I will amend the documentation. Do you know since which version of Mac
?
https://bugs.python.org/issue35716 - mentions CLOCK_MONOTONIC_RAW
has been available since macOS
10.12
.
:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:
^ I guess there it is. It's strange though; the man page says only Linux, but I've found a few other places that recognize Mac:
They are all system-specific. MacOS has some more that are not present on GNU/Linux. Not to mention all other BSDs.
@brandon-leapyear new enough macs have it, OS X prior to (macOS 10.12) DO NOT have
clock_gettime
:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:
My Mac (10.14) has
CLOCK_MONOTONIC_RAW
defined, as evidenced by theClock
constructor:Which then errors in
clockToConst
ifMonotonicRaw
is passed. The logic for clockToConst should follow the same logic as the Clock constructor; that is, don't put the CLOCK_MONOTONIC_RAW/CLOCK_BOOTTIME/etc. within the Linux else-block, but only check the relevant C++ flags.