mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Close #10278: Add time.wallclock() function, monotonic clock.
This commit is contained in:
parent
25d1bdc407
commit
b94b266cfc
5 changed files with 75 additions and 5 deletions
|
@ -183,6 +183,18 @@ The module defines the following functions and data items:
|
|||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
.. 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
|
||||
|
||||
.. function:: ctime([secs])
|
||||
|
||||
|
|
|
@ -396,12 +396,14 @@ New module: :mod:`faulthandler`.
|
|||
time
|
||||
----
|
||||
|
||||
* The :mod:`time` module has new :func:`~time.clock_getres` and
|
||||
:func:`~time.clock_gettime` functions and ``CLOCK_xxx`` constants.
|
||||
:func:`~time.clock_gettime` can be used with :data:`time.CLOCK_MONOTONIC` to
|
||||
get a monotonic clock.
|
||||
The :mod:`time` module has new functions:
|
||||
|
||||
(Contributed by Victor Stinner in :issue:`10278`)
|
||||
* :func:`~time.clock_getres` and :func:`~time.clock_gettime` functions and
|
||||
``CLOCK_xxx`` constants. :func:`~time.clock_gettime` can be used with
|
||||
:data:`time.CLOCK_MONOTONIC` to get a monotonic clock.
|
||||
* :func:`~time.wallclock`: monotonic clock.
|
||||
|
||||
(Contributed by Victor Stinner in :issue:`10278`)
|
||||
|
||||
|
||||
ftplib
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue