[Python-checkins] bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)
Victor Stinner
webhook-mailer at python.org
Thu Jan 10 11:56:42 EST 2019
https://github.com/python/cpython/commit/572168a016ece1b7346695eb7289190c46f1ae55
commit: 572168a016ece1b7346695eb7289190c46f1ae55
branch: master
author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com>
committer: Victor Stinner <vstinner at redhat.com>
date: 2019-01-10T17:56:38+01:00
summary:
bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)
files:
A Misc/NEWS.d/next/Library/2019-01-10-14-03-12.bpo-35702._ct_0H.rst
M Doc/library/time.rst
M Doc/whatsnew/3.8.rst
M Modules/timemodule.c
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index 0ffce475a368..892ed1343a19 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -815,9 +815,21 @@ These constants are used as parameters for :func:`clock_getres` and
.. versionadded:: 3.7
+.. data:: CLOCK_UPTIME_RAW
+
+ Clock that increments monotonically, tracking the time since an arbitrary
+ point, unaffected by frequency or time adjustments and not incremented while
+ the system is asleep.
+
+ .. availability:: macOS 10.12 and newer.
+
+ .. versionadded:: 3.8
+
+
The following constant is the only parameter that can be sent to
:func:`clock_settime`.
+
.. data:: CLOCK_REALTIME
System-wide real-time clock. Setting this clock requires appropriate
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index c592f00d2d9d..370ef4604834 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -234,6 +234,12 @@ Added method :meth:`~tkinter.Canvas.moveto`
in the :class:`tkinter.Canvas` class.
(Contributed by Juliette Monsel in :issue:`23831`.)
+time
+----
+
+Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12.
+(Contributed by Joannah Nanjekye in :issue:`35702`.)
+
unicodedata
-----------
diff --git a/Misc/NEWS.d/next/Library/2019-01-10-14-03-12.bpo-35702._ct_0H.rst b/Misc/NEWS.d/next/Library/2019-01-10-14-03-12.bpo-35702._ct_0H.rst
new file mode 100644
index 000000000000..f97f3d4abb71
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-01-10-14-03-12.bpo-35702._ct_0H.rst
@@ -0,0 +1 @@
+The :data:`time.CLOCK_UPTIME_RAW` constant is now available for macOS 10.12.
\ No newline at end of file
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index fa0f1982c65e..2e0f08d24a66 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1806,6 +1806,9 @@ PyInit_time(void)
#ifdef CLOCK_UPTIME
PyModule_AddIntMacro(m, CLOCK_UPTIME);
#endif
+#ifdef CLOCK_UPTIME_RAW
+ PyModule_AddIntMacro(m, CLOCK_UPTIME_RAW);
+#endif
#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */
More information about the Python-checkins
mailing list