File: interrupt.py

package info (click to toggle)
python-pyinstrument 5.1.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,620 kB
  • sloc: python: 6,713; ansic: 897; makefile: 46; sh: 20; javascript: 18
file content (24 lines) | stat: -rw-r--r-- 290 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 platform import platform

from pyinstrument import Profiler

p = Profiler()

p.start()


def func():
    fd = open("/dev/urandom", "rb")
    _ = fd.read(1024 * 1024)


func()

# this failed on ubuntu 12.04
platform()

p.stop()

print(p.output_text())

p.write_html("ioerror_out.html")