Skip to content

Commit

Permalink
statprof profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
James Casbon committed Jun 28, 2012
1 parent 939e5ce commit 1a95a0c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vcf/test/prof.py
@@ -1,4 +1,4 @@
import vcf as vcf import vcf
import cProfile import cProfile
import timeit import timeit
import pstats import pstats
Expand All @@ -20,5 +20,14 @@ def parse_1kg():
n = 1 n = 1
t = timeit.timeit('parse_1kg()', "from __main__ import parse_1kg", number=n) t = timeit.timeit('parse_1kg()', "from __main__ import parse_1kg", number=n)
print t/n print t/n

elif sys.argv[1] == 'stat':
import statprof
statprof.start()
try:
parse_1kg()
finally:
statprof.stop()
statprof.display()
else: else:
print 'prof.py profile/time' print 'prof.py profile/time'

0 comments on commit 1a95a0c

Please sign in to comment.