[SciPy-user] tic toc in Matlab versus genutils.clock() in IPython

Pearu Peterson pearu at scipy.org
Thu Jun 5 13:23:20 EDT 2003


On Thu, 5 Jun 2003, Fernando Perez wrote:

> I don't know how matlab works, so my comments are of limited value. 
> genutils.clock() in ipython gives you:
> 
> - under unix, the user+system time as returned by the getrusage system call. 

IMHO, the returned user+system time is not very reliable, especially on
multiuser system or when for some reason swapping is under progress or 
.... In such cases I wouldn't use genutils.clock() for measuring the
efficiency of the code as the timing results may be is influenced by
unrelated system activities.

Recall that under linux scipy_test provides jiffies function that returns
the user time, not the user+system time. With jiffies one should get
the same results every time the same code is run, no matter if
the system is idle (up to a current python process) or swapping as crazy.

Regards,
	Pearu




More information about the SciPy-User mailing list