Issue #10278: Drop time.monotonic() function, rename time.wallclock() to time.steady()

* On Mac OS X, time.steady() now uses mach_absolute_time(), a monotonic clock
 * Optimistic change: bet that CLOCK_MONOTONIC and CLOCK_REALTIME are available
   when clock_gettime() is available
 * Rewrite time.steady() documentation
This commit is contained in:
Victor Stinner 2012-03-15 00:58:32 +01:00
parent 5e5451940c
commit ec919cc74d
4 changed files with 27 additions and 109 deletions

View file

@ -226,11 +226,15 @@ The module defines the following functions and data items:
The earliest date for which it can generate a time is platform-dependent.
.. function:: monotonic()
.. function:: steady()
Monotonic non-decreasing clock. The clock is not related to the system clock
and cannot go backward. The reference point of the returned
value is undefined so only the difference of consecutive calls is valid.
.. index::
single: benchmarking
Return the current time as a floating point number expressed in seconds.
This clock advances at a steady rate relative to real time and it may not be
adjusted. The reference point of the returned value is undefined so only the
difference of consecutive calls is valid.
.. versionadded:: 3.3
@ -547,20 +551,6 @@ The module defines the following functions and data items:
('EET', 'EEST')
.. function:: wallclock()
.. index::
single: Wallclock
single: benchmarking
Return the current time in fractions of a second to the system's best ability.
Use this when the most accurate representation of wall-clock is required, i.e.
when "processor time" is inappropriate. The reference point of the returned
value is undefined so only the difference of consecutive calls is valid.
.. versionadded:: 3.3
.. seealso::
Module :mod:`datetime`