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

Fernando Perez fperez at colorado.edu
Thu Jun 5 12:27:28 EDT 2003


Nils Wagner wrote:
> Hi all,
> 
> I wonder, if I can compare the results of 
> Matlab, that is
> 
> tic
> big_calculation()
> toc
> 
> with scipy (ipython)
> 
> from IPython import genutils
> 
> t0 = genutils.clock()
> big_calculcation()
> t1 = genutils.clock()

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. 
It does NOT use the clock() system call, which has wraparound problems. 
Please see the respective manpages for those calls for all the details 
(there's also info in the standard python docs).

- under windows, it is simply time.clock(). I don't know what the timing 
subtleties are in that platform.

Cheers,

f.




More information about the SciPy-User mailing list