diff options
author | zsloan | 2016-06-20 11:03:20 -0500 |
---|---|---|
committer | GitHub | 2016-06-20 11:03:20 -0500 |
commit | 8222ef16d443dc41db9d7e09b1af400d8d866854 (patch) | |
tree | e4f5b49aa21c32aa2b770b1a65c8fef7782b625f /wqflask/maintenance/print_benchmark.py | |
parent | d90dc3748557d1d6fbaa59f71fe676b8a7c393ca (diff) | |
parent | 10df36b60273d81678f6630c07a2d8e5a6409282 (diff) | |
download | genenetwork2-8222ef16d443dc41db9d7e09b1af400d8d866854.tar.gz |
Merge pull request #168 from genenetwork/staging
Staging
Diffstat (limited to 'wqflask/maintenance/print_benchmark.py')
-rwxr-xr-x | wqflask/maintenance/print_benchmark.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wqflask/maintenance/print_benchmark.py b/wqflask/maintenance/print_benchmark.py index 540e0904..ae327cf3 100755 --- a/wqflask/maintenance/print_benchmark.py +++ b/wqflask/maintenance/print_benchmark.py @@ -9,34 +9,34 @@ from pprint import pformat as pf class TheCounter(object): Counters = {} - + def __init__(self): start_time = time.time() for counter in range(170000): self.print_it(counter) self.time_took = time.time() - start_time - TheCounter.Counters[self.__class__.__name__] = self.time_took + TheCounter.Counters[self.__class__.__name__] = self.time_took -class PrintAll(TheCounter): +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 - - + + def new_main(): print("Running new_main") tests = [PrintAll, PrintSome, PrintNone] for test in tests: test() - + print(pf(TheCounter.Counters)) if __name__ == '__main__': |