File: overflow.py

package info (click to toggle)
python-pyinstrument 5.1.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,624 kB
  • sloc: python: 6,713; ansic: 897; makefile: 46; sh: 26; javascript: 18
file content (24 lines) | stat: -rw-r--r-- 273 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pyinstrument import Profiler

p = Profiler()

p.start()


def func(num):
    if num == 0:
        return
    b = 0
    for x in range(1, 100000):
        b += x

    return func(num - 1)


func(900)

p.stop()

print(p.output_text())

p.write_html("overflow_out.html")