.. versionadded:: 3.3
+.. data:: CLOCK_MONOTONIC_RAW_APPROX
+
+ Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by
+ the system at context switch and hence has less accuracy.
+
+ .. availability:: macOS >= 10.12.
+
+ .. versionadded:: 3.13
+
.. data:: CLOCK_PROCESS_CPUTIME_ID
.. versionadded:: 3.8
+.. data:: CLOCK_UPTIME_RAW_APPROX
+
+ Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system
+ at context switches and therefore has less accuracy.
+
+ .. availability:: macOS >= 10.12.
+
+ .. versionadded:: 3.13
+
The following constant is the only parameter that can be sent to
:func:`clock_settime`.
return -1;
}
#endif
-
#ifdef CLOCK_MONOTONIC
-
if (PyModule_AddIntMacro(module, CLOCK_MONOTONIC) < 0) {
return -1;
}
-
#endif
#ifdef CLOCK_MONOTONIC_RAW
if (PyModule_AddIntMacro(module, CLOCK_MONOTONIC_RAW) < 0) {
return -1;
}
#endif
-
#ifdef CLOCK_HIGHRES
if (PyModule_AddIntMacro(module, CLOCK_HIGHRES) < 0) {
return -1;
return -1;
}
#endif
-
#ifdef CLOCK_THREAD_CPUTIME_ID
if (PyModule_AddIntMacro(module, CLOCK_THREAD_CPUTIME_ID) < 0) {
return -1;
}
#endif
#ifdef CLOCK_UPTIME_RAW
-
if (PyModule_AddIntMacro(module, CLOCK_UPTIME_RAW) < 0) {
return -1;
}
+#endif
+#ifdef CLOCK_MONOTONIC_RAW_APPROX
+ if (PyModule_AddIntMacro(module, CLOCK_MONOTONIC_RAW_APPROX) < 0) {
+ return -1;
+ }
+#endif
+#ifdef CLOCK_UPTIME_RAW_APPROX
+ if (PyModule_AddIntMacro(module, CLOCK_UPTIME_RAW_APPROX) < 0) {
+ return -1;
+ }
#endif
}