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
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