[Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

Jim J. Jewett jimjjewett at gmail.com
Sat Mar 24 03:36:30 CET 2012
In http://mail.python.org/pipermail/python-dev/2012-March/118024.html
Steven D'Aprano wrote:

> What makes this "steady", given that it can be adjusted
> and it can go backwards?

It is best-effort for steady, but putting "best" in the name would
be an attractive nuisance.

> Is steady() merely a convenience function to avoid the user
> having to write something like this?

>  try:
>     mytimer = time.monotonic
>  except AttributeError:
>     mytimer = time.time

That would still be worth doing.  But I think the main point is
that the clock *should* be monotonic, and *should* be as precise
as possible.

Given that it returns seconds elapsed (since an undefined start),
perhaps it should be

    time.seconds()

or even

    time.counter()

-jJ

-- 

If there are still threading problems with my replies, please 
email me with details, so that I can try to resolve them.  -jJ



More information about the Python-Dev mailing list