[IPython-User] timing Python fragments with %time
Mon Dec 27 11:40:51 CST 2010
Current IPython magics are only single line so putting the code into a
function is the only way of handling this currently. Sorry...
On Sat, Dec 25, 2010 at 4:19 PM, Ben Elliston <firstname.lastname@example.org> wrote:
> Hi all.
> I'm trying to use the %time command to time fragments of Python code,
> like so:
> In : %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
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> -----END PGP SIGNATURE-----
> IPython-User mailing list
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
More information about the IPython-User