1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class CountTime(object):
8 def __init__(self, tag="", size=None):
13 self.start = time.time()
16 def __exit__(self, exc_type, exc_value, traceback):
17 sec = (time.time() - self.start)
20 th = "throughput %s/sec" % (self.size / sec)
21 print "%s time %s micoseconds %s" % (self.tag, sec*1000000, th)