pocketpy/tests/84_line_profiler.py
2024-02-07 13:56:29 +08:00

16 lines
208 B
Python

from line_profiler import LineProfiler
def my_func():
a = 0
for i in range(1000000):
a += i
return a
lp = LineProfiler()
lp.add_function(my_func)
lp.runcall(my_func)
lp.print_stats()