mirror of
https://github.com/KevinMidboe/mktxp-no-cli.git
synced 2025-12-08 20:38:48 +00:00
DS refactor, fixes/optimizations
This commit is contained in:
@@ -37,15 +37,6 @@ def temp_dir(quiet = True):
|
|||||||
if not quiet:
|
if not quiet:
|
||||||
print ('Error while removing a tmp dir: {}'.format(e.args[0]))
|
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):
|
class CmdProcessingError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -264,3 +255,12 @@ class RepeatableTimer:
|
|||||||
break
|
break
|
||||||
self.finished.wait(self.interval)
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user