Add user/system time to benchmark output

This commit is contained in:
René Stadler 2007-11-17 10:23:58 +02:00 committed by Stefan Sauer
parent 887ae6d898
commit fad744c07f

View file

@ -1260,6 +1260,11 @@ class TestParsingPerformance (object):
print "data parsed in %0.1f ms" % (diff * 1000.,)
print "overall time spent: %0.1f s" % (time.time () - self.start_time,)
import resource
rusage = resource.getrusage (resource.RUSAGE_SELF)
print "time spent in user mode: %.2f s" % (rusage.ru_utime,)
print "time spent in system mode: %.2f s" % (rusage.ru_stime,)
def main ():
if len (sys.argv) > 1 and sys.argv[1] == "benchmark":