Skip to content

Commit

Permalink
bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
nanjekyejoannah authored and vstinner committed Jan 10, 2019
1 parent 89c4f90 commit 572168a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Doc/library/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The :data:`time.CLOCK_UPTIME_RAW` constant is now available for macOS 10.12.
3 changes: 3 additions & 0 deletions Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */

Expand Down

0 comments on commit 572168a

Please sign in to comment.