##// END OF EJS Templates
Backport PR #13125: Improve formatting of %time documentation
Blazej Michalik -
Show More
@@ -1244,22 +1244,25 b' python-profiler package from non-free.""")'
1244 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1244 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1245 Wall time: 0.00
1245 Wall time: 0.00
1246
1246
1247 Note that the time needed by Python to compile the given expression
1248 will be reported if it is more than 0.1s. In this example, the
1249 actual exponentiation is done by Python at compilation time, so while
1250 the expression can take a noticeable amount of time to compute, that
1251 time is purely due to the compilation:
1252
1247
1253 In [5]: %time 3**9999;
1248 .. note::
1254 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1249 The time needed by Python to compile the given expression will be
1255 Wall time: 0.00 s
1250 reported if it is more than 0.1s.
1256
1251
1257 In [6]: %time 3**999999;
1252 In the example below, the actual exponentiation is done by Python
1258 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1253 at compilation time, so while the expression can take a noticeable
1259 Wall time: 0.00 s
1254 amount of time to compute, that time is purely due to the
1260 Compiler : 0.78 s
1255 compilation::
1261 """
1262
1256
1257 In [5]: %time 3**9999;
1258 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1259 Wall time: 0.00 s
1260
1261 In [6]: %time 3**999999;
1262 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
1263 Wall time: 0.00 s
1264 Compiler : 0.78 s
1265 """
1263 # fail immediately if the given expression can't be compiled
1266 # fail immediately if the given expression can't be compiled
1264
1267
1265 if line and cell:
1268 if line and cell:
General Comments 0
You need to be logged in to leave comments. Login now