diff options
author | Pjotr Prins | 2016-06-17 06:48:01 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-06-17 06:48:01 +0000 |
commit | 93e3878c8b97ecbf28630e4bb3733a29f4cf45aa (patch) | |
tree | ef92de7c75b7899b406e99c97006a7e2b20bd86b /wqflask/utility/benchmark.py | |
parent | eb84f7c0e384e08b810e052fd3935f6d977b7ea2 (diff) | |
parent | 10df36b60273d81678f6630c07a2d8e5a6409282 (diff) | |
download | genenetwork2-93e3878c8b97ecbf28630e4bb3733a29f4cf45aa.tar.gz |
Conflict
Diffstat (limited to 'wqflask/utility/benchmark.py')
-rwxr-xr-x | wqflask/utility/benchmark.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wqflask/utility/benchmark.py b/wqflask/utility/benchmark.py index 182187ae..d5b32703 100755 --- a/wqflask/utility/benchmark.py +++ b/wqflask/utility/benchmark.py @@ -7,7 +7,7 @@ import time class Bench(object): entries = collections.OrderedDict() - + def __init__(self, name=None): self.name = name @@ -26,10 +26,10 @@ class Bench(object): time_taken = time.time() - self.start_time print(" %s took: %f seconds" % (name, (time_taken))) - + if self.name: Bench.entries[self.name] = Bench.entries.get(self.name, 0) + time_taken - + @classmethod def report(cls): @@ -39,7 +39,7 @@ class Bench(object): percent = int(round((time_taken/total_time) * 100)) print("[{}%] {}: {}".format(percent, name, time_taken)) print() - + def reset(cls): """Reset the entries""" cls.entries = collections.OrderedDict()
\ No newline at end of file |