Skip to content

Commit 572168a

Browse files
nanjekyejoannahvstinner
authored andcommitted
bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)
1 parent 89c4f90 commit 572168a

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

Doc/library/time.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,21 @@ These constants are used as parameters for :func:`clock_getres` and
815815
.. versionadded:: 3.7
816816

817817

818+
.. data:: CLOCK_UPTIME_RAW
819+
820+
Clock that increments monotonically, tracking the time since an arbitrary
821+
point, unaffected by frequency or time adjustments and not incremented while
822+
the system is asleep.
823+
824+
.. availability:: macOS 10.12 and newer.
825+
826+
.. versionadded:: 3.8
827+
828+
818829
The following constant is the only parameter that can be sent to
819830
:func:`clock_settime`.
820831

832+
821833
.. data:: CLOCK_REALTIME
822834

823835
System-wide real-time clock. Setting this clock requires appropriate

Doc/whatsnew/3.8.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ Added method :meth:`~tkinter.Canvas.moveto`
234234
in the :class:`tkinter.Canvas` class.
235235
(Contributed by Juliette Monsel in :issue:`23831`.)
236236

237+
time
238+
----
239+
240+
Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12.
241+
(Contributed by Joannah Nanjekye in :issue:`35702`.)
242+
237243
unicodedata
238244
-----------
239245

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The :data:`time.CLOCK_UPTIME_RAW` constant is now available for macOS 10.12.

Modules/timemodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,9 @@ PyInit_time(void)
18061806
#ifdef CLOCK_UPTIME
18071807
PyModule_AddIntMacro(m, CLOCK_UPTIME);
18081808
#endif
1809+
#ifdef CLOCK_UPTIME_RAW
1810+
PyModule_AddIntMacro(m, CLOCK_UPTIME_RAW);
1811+
#endif
18091812

18101813
#endif /* defined(HAVE_CLOCK_GETTIME) || defined(HAVE_CLOCK_SETTIME) || defined(HAVE_CLOCK_GETRES) */
18111814

0 commit comments

Comments
 (0)