From: Victor Stinner Date: Mon, 2 Apr 2012 22:31:17 +0000 (+0200) Subject: Add time.CLOCK_HIGHRES constant, needed on Solaris X-Git-Tag: v3.3.0a3~328^2^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1470f35bc62c3cf21b209fa8e353d8ea9e71b46b;p=thirdparty%2FPython%2Fcpython.git Add time.CLOCK_HIGHRES constant, needed on Solaris --- diff --git a/Doc/library/time.rst b/Doc/library/time.rst index 581b68af9d00..f87fa64054e2 100644 --- a/Doc/library/time.rst +++ b/Doc/library/time.rst @@ -159,6 +159,15 @@ The module defines the following functions and data items: .. versionadded:: 3.3 +.. data:: CLOCK_HIGHRES + + The Solaris OS has a CLOCK_HIGHRES timer that attempts to use an optimal + hardware source, and may give close to nanosecond resolution. CLOCK_HIGHRES + is the nonadjustable, high-resolution clock. + + .. versionadded:: 3.3 + + .. data:: CLOCK_MONOTONIC Clock that cannot be set and represents monotonic time since some diff --git a/Modules/timemodule.c b/Modules/timemodule.c index f44e0c40c4eb..0fe1b17dd497 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -962,6 +962,9 @@ PyInit_timezone(PyObject *m) { #ifdef CLOCK_MONOTONIC_RAW PyModule_AddIntMacro(m, CLOCK_MONOTONIC_RAW); #endif +#ifdef CLOCK_HIGHRES + PyModule_AddIntMacro(m, CLOCK_HIGHRES); +#endif #ifdef CLOCK_PROCESS_CPUTIME_ID PyModule_AddIntMacro(m, CLOCK_PROCESS_CPUTIME_ID); #endif