3 class CountTime(object):
4 def __init__(self, tag="", size=None):
9 self.start = time.time()
12 def __exit__(self, exc_type, exc_value, traceback):
13 sec = (time.time() - self.start)
16 th = "throughput %s/sec" % (self.size / sec)
17 print "%s time %s micoseconds %s" % (self.tag, sec*1000000, th)