10

The %time magic command allows you to conveniently time a single line of Python code.

Can I also time a block of code without wrapping it in a function first? Is there an equivalent function that times an entire cell?

clstaudt
  • 21,436
  • 45
  • 156
  • 239

1 Answers1

13

Cell magics starts with %% while line magics starts with %.

http://ipython.org/ipython-doc/dev/interactive/tutorial.html#magic-functions

Mohamed AL ANI
  • 2,012
  • 1
  • 12
  • 29