Permalink
Browse files

statprof profiling

  • Loading branch information...
1 parent 939e5ce commit 1a95a0c3c96de144103720f9b2969de02a863adf James Casbon committed Jun 28, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 vcf/test/prof.py
View
@@ -1,4 +1,4 @@
-import vcf as vcf
+import vcf
import cProfile
import timeit
import pstats
@@ -20,5 +20,14 @@ def parse_1kg():
n = 1
t = timeit.timeit('parse_1kg()', "from __main__ import parse_1kg", number=n)
print t/n
+
+elif sys.argv[1] == 'stat':
+ import statprof
+ statprof.start()
+ try:
+ parse_1kg()
+ finally:
+ statprof.stop()
+ statprof.display()
else:
print 'prof.py profile/time'

0 comments on commit 1a95a0c

Please sign in to comment.