[Python-Dev] Drop the new time.wallclock() function? (original) (raw)
Kristján Valur Jónsson kristjan at ccpgames.com
Wed Mar 14 18:09:39 CET 2012
- Previous message: [Python-Dev] Drop the new time.wallclock() function?
- Next message: [Python-Dev] Drop the new time.wallclock() function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- By default, it should fall back to time.time if a better source is not available, but there should be a flag that can disable this fallback for users who really need a monotonic/steady time source. As pointed out on a different thread, you don"t need this "flag" since the code can easily enforce the monotonic property by maintaining a static value. This is how we worked around buggy implementations of QueryPerformanceCounter on windows (). K
-----Original Message----- From: python-dev-bounces+kristjan=ccpgames.com at python.org [mailto:python-dev-bounces+kristjan=ccpgames.com at python.org] On Behalf Of Nadeem Vawda Sent: 14. mars 2012 09:47 To: Guido van Rossum Cc: Antoine Pitrou; python-dev at python.org Subject: Re: [Python-Dev] Drop the new time.wallclock() function?
A summary of the discussion so far, as I've understood it:
We should have one monotonic/steady timer function, using the sources described in Victor's original post.
By default, it should fall back to time.time if a better source is not available, but there should be a flag that can disable this fallback for users who really need a monotonic/steady time source.
Proposed names for the function:
- monotonic
- steady_clock
- wallclock
- realtime
Proposed names for the flag controlling fallback behavior:
- strict (=False)
- fallback (=True)
- monotonic (=False)
For the function name, I think monotonic() and steady_clock() convey the purpose of the function much better than the other two; the term "wallclock" is actively misleading, and "realtime" seems ambiguous.
For the flag name, I'm -1 on "monotonic" -- it sounds like a flag to decide whether to use a monotonic time source always or never, while it actually decides between "always" and "sometimes". I think "strict" is nicer than "fallback", but I'm fine with either one.
Cheers, Nadeem
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/kristjan%40ccpgames.com
- Previous message: [Python-Dev] Drop the new time.wallclock() function?
- Next message: [Python-Dev] Drop the new time.wallclock() function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]