[IPython-User] timing Python fragments with %time

Ben Elliston bje@air.net...
Sat Dec 25 18:19:16 CST 2010

Hi all.

I'm trying to use the %time command to time fragments of Python code,
like so:

In [1]: %time for i in range (1000):
	some_function (i)

It seems that the only way to make this work is to place the loop
inside a function definition and call that function instead.  Is there
a better way?

Thanks, Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.scipy.org/pipermail/ipython-user/attachments/20101226/a7db8402/attachment.bin 

More information about the IPython-User mailing list