PEP 418: List limitations of this PEP

This commit is contained in:
Victor Stinner 2012-04-21 02:36:52 +02:00
parent 1802251773
commit d0166c382d
1 changed files with 21 additions and 0 deletions

View File

@ -74,6 +74,27 @@ portable: it behaves differently depending on the operating system.
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
================