bench_build_time.py 266 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import cProfile
import re
import pstats

import io

pr = cProfile.Profile()
pr.enable()

import spconv
pr.disable()
s = io.StringIO()
ps = pstats.Stats(pr, stream=s).sort_stats('tottime')
ps.print_stats()

with open('test.txt', 'w') as f:
    f.write(s.getvalue())