aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/print_benchmark.py
diff options
context:
space:
mode:
authorArthur Centeno2021-06-15 15:33:59 +0000
committerArthur Centeno2021-06-15 15:33:59 +0000
commitc1a6ca69f7c48d99b6c5d62e56a445583fd4c08b (patch)
treef98fccc44829e3f52e585d6b41a1942aa52bd8b7 /wqflask/maintenance/print_benchmark.py
parent7e49c006af9c4f7453c3578a7d4f1fc4d7bdf3ed (diff)
parent9e9e0e4d440383f617542e810a1115833eafd7bf (diff)
downloadgenenetwork2-c1a6ca69f7c48d99b6c5d62e56a445583fd4c08b.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into acenteno
Diffstat (limited to 'wqflask/maintenance/print_benchmark.py')
-rw-r--r--wqflask/maintenance/print_benchmark.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/wqflask/maintenance/print_benchmark.py b/wqflask/maintenance/print_benchmark.py
index b24ce4f1..9d12da8a 100644
--- a/wqflask/maintenance/print_benchmark.py
+++ b/wqflask/maintenance/print_benchmark.py
@@ -5,7 +5,7 @@ import time
from pprint import pformat as pf
-class TheCounter(object):
+class TheCounter:
Counters = {}
def __init__(self):
@@ -15,15 +15,18 @@ class TheCounter(object):
self.time_took = time.time() - start_time
TheCounter.Counters[self.__class__.__name__] = self.time_took
+
class PrintAll(TheCounter):
def print_it(self, counter):
print(counter)
+
class PrintSome(TheCounter):
def print_it(self, counter):
if counter % 1000 == 0:
print(counter)
+
class PrintNone(TheCounter):
def print_it(self, counter):
pass
@@ -37,5 +40,6 @@ def new_main():
print(pf(TheCounter.Counters))
+
if __name__ == '__main__':
new_main()