Source code for pumapy.utilities.timer

import time


[docs]class Timer: current = 0 def __init__(self): self.current = time.perf_counter()
[docs] def start(self): self.current = time.perf_counter()
[docs] def reset(self): self.current = time.perf_counter()
[docs] def elapsed(self): return time.perf_counter() - self.current
[docs] def print_elapsed(self, msg=""): print(msg, (time.perf_counter() - self.current))