diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py index e0b7040..3aa0a27 100644 --- a/IPython/core/magics/execution.py +++ b/IPython/core/magics/execution.py @@ -195,12 +195,16 @@ class ExecutionMagics(Magics): """Run a statement through the python code profiler. - Usage, in line mode: + **Usage, in line mode:** + %prun [options] statement - Usage, in cell mode: + **Usage, in cell mode:** + %%prun [options] [statement] + code... + code... In cell mode, the additional code lines are appended to the (possibly @@ -1028,12 +1032,17 @@ class ExecutionMagics(Magics): def timeit(self, line='', cell=None, local_ns=None): """Time execution of a Python statement or expression - Usage, in line mode: + **Usage, in line mode:** + %timeit [-n -r [-t|-c] -q -p

-o] statement - or in cell mode: + + **or in cell mode:** + %%timeit [-n -r [-t|-c] -q -p

-o] setup_code - code - code... + + code + + code... Time execution of a Python statement or expression using the timeit module. This function can be used both as a line and cell magic: @@ -1046,6 +1055,7 @@ class ExecutionMagics(Magics): body has access to any variables created in the setup code. Options: + -n: execute the given statement times in a loop. If is not provided, is determined so as to get sufficient accuracy. @@ -1066,7 +1076,7 @@ class ExecutionMagics(Magics): -q: Quiet, do not print result. -o: return a TimeitResult that can be stored in a variable to inspect - the result in more details. + the result in more details. .. versionchanged:: 7.3 User variables are no longer expanded,