stopwatch.py 171 B

1234567
  1. import time
  2. class Stopwatch(object):
  3. def __init__(self):
  4. self.start_time = time.time()
  5. def time(self):
  6. return time.time() - self.start_time