]> granicus.if.org Git - python/commitdiff
Add time.CLOCK_HIGHRES constant, needed on Solaris
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 2 Apr 2012 22:31:17 +0000 (00:31 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 2 Apr 2012 22:31:17 +0000 (00:31 +0200)
Doc/library/time.rst
Modules/timemodule.c

index 581b68af9d002066cc5b1d9c43bf432aabd9cab6..f87fa64054e203dbd1aeefeaab3de1ed603b748e 100644 (file)
@@ -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
index f44e0c40c4eb93bba2a51ea6a28e20071c5101a8..0fe1b17dd4978325e93900c8dfd0b9bf3e24cee1 100644 (file)
@@ -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