[Numpy-discussion] best way of counting time and cputime?

bernhard.voigt at gmail.com bernhard.voigt at gmail.com
Sat May 12 05:51:53 EDT 2007


It depends on what you're aiming at. If you want to compare different
implementations of some expressions and need to know their average
execution times you should use the timeit module. If you want to have
the full execution time of a script, time.time (call at the begin and
end, compute the difference, gives the elapsed time) and time.clock
(under linux the cpu clock time used by the process) are the methods
you want.

Cheers! Bernhard

On May 12, 12:22 am, dmitrey <open... at ukr.net> wrote:
> hi all,
> please inform me which way for counting elapsed time and cputime in
> Python is best? Previously in some Python sources I noticed there are
> some ones.
> Currently I use time.time() for time.
> Thx, D.
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discuss... at scipy.orghttp://projects.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list