rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.6k stars 254 forks source link

does line_profiler support %%lprun Magics #102

Closed weiguang-zz closed 6 years ago

weiguang-zz commented 6 years ago

for example, i can use the %%prun magics to test the whole cell code

%%prun
import time
time.sleep(2)
         3 function calls in 2.002 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    2.002    2.002    2.002    2.002 {time.sleep}
        1    0.000    0.000    2.002    2.002 <string>:2(<module>)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}

i want to ask if the line_profiler support the %%lprun applying to the whole cell. for example:

%%lprun
import time
time.sleep(2)

thank you!

brettolsen commented 6 years ago

Nope, sorry.