Commits

Anonymous committed 81f8a9e

Optional profiling added

  • Participants
  • Parent commits fe3273b

Comments (0)

Files changed (1)

     parser.add_option('-v', '--verbose', dest='verbose',
             action='store_true', default=False,
             help="show traceback infomation if a test fails")
+
+    parser.add_option('-p', '--profile', dest='profile',
+            action='store_true', default=False,
+            help="store profiling log for every test")
+            
     global options
     options, args = parser.parse_args()
 
     global total_time
     total_time = 0
 
+    
     print "Benchmarking %s..." % module_name
+    
+    if options.profile:
+        import hotshot
+        prof = hotshot.Profile("%s.prof" % name)
+        prof.start()
+        
     Benchmark(module, options)
 
+    if options.profile:
+        prof.stop()
+        prof.close()
+
     print "Total_time is %f" % total_time
     print '---'
 
         ('handlersocket', handlersocket)
     ]
 
+
     for name, module in modules:
         main(name, module)