A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-March/117790.html below:

[Python-Dev] cpython: Issue #10278: Add an optional strict argument to time.steady(), False by default

[Python-Dev] cpython: Issue #10278: Add an optional strict argument to time.steady(), False by default [Python-Dev] cpython: Issue #10278: Add an optional strict argument to time.steady(), False by defaultVictor Stinner victor.stinner at gmail.com
Mon Mar 19 13:35:49 CET 2012
>>> This is not clear to me.  Why wouldn't it raise OSError on error even with
>>> strict=False?  Please clarify which exception is raised in which case.
>>
>> It seems clear to me. It doesn't raise exceptions when strict=False because
>> it falls back to a non-monotonic clock. If strict is True and a non-monotonic
>> clock is not available it raises OSError or NotImplementedError.
>
> So errors are ignored when strict is false?

Said differently: time.steady(strict=True) is always monotonic (*),
whereas time.steady() may or may not be monotonic, depending on what
is avaiable.

time.steady() is a best-effort steady clock.

(*) time.steady(strict=True) relies on the OS monotonic clock. If the
OS provides a "not really monotonic" clock, Python cannot do better.
For example, clock_gettime(CLOCK_MONOTONIC) speed can be adjusted by
NTP on Linux. Python tries to use clock_gettime(CLOCK_MONOTONIC_RAW)
which doesn't have this issue.

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4