This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jim.Jewett
Recipients Jim.Jewett, docs@python, vstinner
Date 2012-03-23.22:38:17
SpamBayes Score 2.1469127e-08
Marked as misclassified No
Message-id <1332542298.52.0.507304960878.issue14318@psf.upfronthosting.co.za>
In-reply-to
Content
(1)  How does the user control (or even find out) which clock is used by time.steady()?

If the answer is time.steady(clock=QueryPerformanceCounter) then there is no need for strict=?, but then I'm not sure what the point of time.steady itself is.

I had been assuming that time.steady() relied on the best clock it could find, which shouldn't normally change on a specific machine, let alone within a single process.  In that case, exposing the actual clock (or its name) as an attribute seems better than a boolean "complain_if_my_machine_is_not_good_enough" parameter.


(2)  That fragment from the C++ standard suggests that "MAY NOT" ought to have been replaced by the unambiguous "MUST NOT".  I do not think that python should repeat the editorial error.

(3)  Even leaving aside the question of which clock is actually provided, I still prefer a change in wording.  My trailing paragraph might change with the API, but the rationale for:

"""Return elapsed seconds as a floating point number.  

The start time is undefined, so only differences between calls are meaningful.  steady() is the best clock for profiling response time, as opposed to CPU usage.
"""

includes:

"elapsed" ==> time since something, as opposed to absolute time.  

If practicality and efficiency weren't important, I would even suggest that the function return an opaque object that supported only ordering and subtraction (returning a timedelta).

There are enough time-related modules/classes/functions/etc that people *will* get confused; the name "steady" isn't obvious enough. Including the intended use case in the docstring gives people a fighting chance.
History
Date User Action Args
2012-03-23 22:38:18Jim.Jewettsetrecipients: + Jim.Jewett, vstinner, docs@python
2012-03-23 22:38:18Jim.Jewettsetmessageid: <1332542298.52.0.507304960878.issue14318@psf.upfronthosting.co.za>
2012-03-23 22:38:17Jim.Jewettlinkissue14318 messages
2012-03-23 22:38:17Jim.Jewettcreate