Victor Stinner wrote:
[...]
So we will have:

- time.time(): realtime, can be adjusted by the system administrator
(manually) or automatically by NTP
- time.clock(): monotonic clock on Windows, CPU time on UNIX
- time.monotonic(): monotonic clock, its speed may or may not be
adjusted by NTP but it only goes forward, may raise an OSError

This all sounds good to me. +1 up to this point.

Question: under what circumstances will monotonic() exist but raise OSError?


- time.steady(): monotonic clock or the realtime clock, depending on
what is available on the platform (use monotonic in priority). may be
adjusted by NTP or the system administrator, may go backward.

What makes this "steady", given that it can be adjusted and it can go backwards? Doesn't sound steady to me.

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


or inline:

try:
  return time.monotonic()
except (NotImplementError, OSError):
  return time.time()

Should that be (AttributeError, OSError) instead?



--
Steven
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to