[IPython-dev] Feature request/how?
vivainio at kolumbus.fi
Tue Feb 22 16:24:03 EST 2005
On Tue, 2005-02-22 at 12:05 -0700, Fernando.Perez at colorado.edu wrote:
>This is expected: the code I gave you uses genutils.clock(), which is written
>(at least on Unix) to report only true CPU time. A sleep() call doesn't
>consume almost any cpu time at all. Feel free to make a modified version of
>this function which uses other timing routines from the time module if you want
>wall clock time. As far as I'm concerned, reporting wall clock time is in most
>cases a bug, since it's completely context dependent. But there are valid
>cases for wanting it, so you could for example add a -w switch to this function
>to use a wall clock instead.
I'd be tempted to think that wall clock time should be the default.
Isn't CPU time quite arbitrary measurement if the problem is I/O bound?
timeit module also measures wallclock time (using time.time() on posix).
Knowing the wallclock time is also necessary to see whether the solution
under experimentation will fly in a real application. It's hard to get
an intuitive grasp from CPU time.
More information about the IPython-dev