Show More
@@ -195,12 +195,16 class ExecutionMagics(Magics): | |||||
195 |
|
195 | |||
196 | """Run a statement through the python code profiler. |
|
196 | """Run a statement through the python code profiler. | |
197 |
|
197 | |||
198 | Usage, in line mode: |
|
198 | **Usage, in line mode:** | |
|
199 | ||||
199 | %prun [options] statement |
|
200 | %prun [options] statement | |
200 |
|
201 | |||
201 | Usage, in cell mode: |
|
202 | **Usage, in cell mode:** | |
|
203 | ||||
202 | %%prun [options] [statement] |
|
204 | %%prun [options] [statement] | |
|
205 | ||||
203 | code... |
|
206 | code... | |
|
207 | ||||
204 | code... |
|
208 | code... | |
205 |
|
209 | |||
206 | In cell mode, the additional code lines are appended to the (possibly |
|
210 | In cell mode, the additional code lines are appended to the (possibly | |
@@ -1028,11 +1032,16 class ExecutionMagics(Magics): | |||||
1028 | def timeit(self, line='', cell=None, local_ns=None): |
|
1032 | def timeit(self, line='', cell=None, local_ns=None): | |
1029 | """Time execution of a Python statement or expression |
|
1033 | """Time execution of a Python statement or expression | |
1030 |
|
1034 | |||
1031 | Usage, in line mode: |
|
1035 | **Usage, in line mode:** | |
|
1036 | ||||
1032 | %timeit [-n<N> -r<R> [-t|-c] -q -p<P> -o] statement |
|
1037 | %timeit [-n<N> -r<R> [-t|-c] -q -p<P> -o] statement | |
1033 | or in cell mode: |
|
1038 | ||
|
1039 | **or in cell mode:** | |||
|
1040 | ||||
1034 | %%timeit [-n<N> -r<R> [-t|-c] -q -p<P> -o] setup_code |
|
1041 | %%timeit [-n<N> -r<R> [-t|-c] -q -p<P> -o] setup_code | |
|
1042 | ||||
1035 | code |
|
1043 | code | |
|
1044 | ||||
1036 | code... |
|
1045 | code... | |
1037 |
|
1046 | |||
1038 | Time execution of a Python statement or expression using the timeit |
|
1047 | Time execution of a Python statement or expression using the timeit | |
@@ -1046,6 +1055,7 class ExecutionMagics(Magics): | |||||
1046 | body has access to any variables created in the setup code. |
|
1055 | body has access to any variables created in the setup code. | |
1047 |
|
1056 | |||
1048 | Options: |
|
1057 | Options: | |
|
1058 | ||||
1049 | -n<N>: execute the given statement <N> times in a loop. If <N> is not |
|
1059 | -n<N>: execute the given statement <N> times in a loop. If <N> is not | |
1050 | provided, <N> is determined so as to get sufficient accuracy. |
|
1060 | provided, <N> is determined so as to get sufficient accuracy. | |
1051 |
|
1061 |
General Comments 0
You need to be logged in to leave comments.
Login now