| 1 |
from pyinstrument import Profiler |
| 2 |
|
| 3 |
p = Profiler() |
| 4 |
|
| 5 |
p.start() |
| 6 |
|
| 7 |
|
| 8 |
def func(num): |
| 9 |
if num == 0: |
| 10 |
return |
| 11 |
b = 0 |
| 12 |
for x in range(1, 100000): |
| 13 |
b += x |
| 14 |
|
| 15 |
return func(num - 1) |
| 16 |
|
| 17 |
|
| 18 |
func(900) |
| 19 |
|
| 20 |
p.stop() |
| 21 |
|
| 22 |
print(p.output_text()) |
| 23 |
|
| 24 |
p.write_html("overflow_out.html") |