[Python-checkins] peps: PEP 418: List limitations of this PEP

victor.stinner python-checkins at python.org
Sat Apr 21 02:36:57 CEST 2012


http://hg.python.org/peps/rev/a96b9319dc84
changeset:   4290:a96b9319dc84
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Apr 21 02:36:52 2012 +0200
summary:
  PEP 418: List limitations of this PEP

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


diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -74,6 +74,27 @@
 instead, depending on your requirements. ``time.clock()`` is marked as
 deprecated but is not planned for removal.
 
+Limitations:
+
+* The behaviour of clocks after a system suspend is not defined in the
+  documentation of new functions. The behaviour depends on the
+  operating system: see the `Monotonic Clocks`_ section below. Some
+  recent operating systems provide two clocks, one including time
+  elapsed during system suspsend, one not including this time. Most
+  operating systems only provide one kind of clock.
+* time.monotonic() and time.perf_counter() may or may not be adjusted.
+  For example, ``CLOCK_MONOTONIC`` is slewed on Linux, whereas
+  ``GetTickCount()`` is not adjusted on Windows.
+  ``time.get_clock_info('monotonic')['is_adjusted']`` can be used to check
+  if the monotonic clock is adjusted or not.
+* No time.thread_time() function is proposed by this PEP because it is
+  not needed by Python standard library nor a common asked feature.
+  Such function would only be available on Windows and Linux. On
+  Linux, it is possible use use
+  ``time.clock_gettime(CLOCK_THREAD_CPUTIME_ID)``. On Windows, ctypes or
+  another module can be used to call the ``GetThreadTimes()``
+  function.
+
 
 Python functions
 ================

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


More information about the Python-checkins mailing list