ANN: a new utility for Python developers
Skip Montanaro
skip at pobox.com
Tue Aug 21 00:40:22 EDT 2001
Erno> yes, but since gettimeofday() has about 10000 times more
Erno> resolution and the user time measurement on most platforms that i
Erno> know of is so unreliable/imprecise, and that you probably need to
Erno> be on a quiescent machine anyway to do profiling, this does not
Erno> look like a very good solution.
I think you're missing the point. It doesn't matter if gettimeofday is tied
to an atomic clock at NIST. It's measuring the wrong quantity.
Erno> if a cycle counter - a device that measures real time - is deemed
Erno> a good thing to use on windows, it probably isn't a very important
Erno> requirement to only measure cpu time.
Perhaps not, but Python is striving to present a time module this provides
some cross-platform semantic consistency. time.time is there to measure
wall clock time. Making time.clock measure CPU time on one platform and
wall clock time on another makes it worthless unless you know the details of
the various systems at your disposal (and if you ever want to distribute
applications, to the various systems at your clients' disposal).
Skip
More information about the Python-list
mailing list