diff --git a/mktxp/utils/utils.py b/mktxp/utils/utils.py index 6bfb9e7..71aa366 100755 --- a/mktxp/utils/utils.py +++ b/mktxp/utils/utils.py @@ -37,15 +37,6 @@ def temp_dir(quiet = True): if not quiet: print ('Error while removing a tmp dir: {}'.format(e.args[0])) -class Benchmark: - def __enter__(self): - self.start = default_timer() - return self - - def __exit__(self, *args): - self.time = default_timer() - self.start - - class CmdProcessingError(Exception): pass @@ -264,3 +255,12 @@ class RepeatableTimer: break self.finished.wait(self.interval) +class Benchmark: + def __enter__(self): + self.start = default_timer() + return self + + def __exit__(self, *args): + self.time = default_timer() - self.start + +