[Python-checkins] peps: PEP 418: time.get_clock_info() may provide more information (accuracy,

victor.stinner python-checkins at python.org
Mon Apr 2 21:48:06 CEST 2012


http://hg.python.org/peps/rev/aeff04d14ad8
changeset:   4186:aeff04d14ad8
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Apr 02 21:48:03 2012 +0200
summary:
  PEP 418: time.get_clock_info() may provide more information (accuracy, is_adjusted)

files:
  pep-0418.txt |  21 ++++++++++++++-------
  1 files changed, 14 insertions(+), 7 deletions(-)


diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -201,20 +201,27 @@
 time.get_clock_info(name)
 -------------------------
 
-Get information on the specified time function as a dictionary. Only the following
-names are accepted:
+Get information on the specified clock. Supported clocks:
 
  * "clock": time.clock()
  * "highres": time.highres()
  * "monotonic": time.monotonic()
  * "time": time.time()
 
-The following keys are always present:
+Return a dictionary with the following keys:
 
- * "function" (str): name of the underlying operating system function (ex:
-   "QueryPerformanceCounter()" or "clock_gettime(CLOCK_REALTIME)")
- * "resolution" (float): resolution in seconds of the function
- * "is_monotonic" (bool): True if the clock is monotonic
+ * Mandatory keys:
+
+   * "function" (str): name of the underlying operating system function.
+     Examples: "QueryPerformanceCounter()", "clock_gettime(CLOCK_REALTIME)".
+   * "resolution" (float): resolution in seconds of the clock
+   * "is_monotonic" (bool): True if the clock cannot go backward
+
+ * Optional keys:
+
+   * "accuracy" (float): accuracy in seconds of the clock
+   * "is_adjusted" (bool): True if the clock can be adjusted (e.g. by a NTP
+     daemon)
 
 
 Hardware clocks

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list