tic-far-toe/Timer.py

18 lines
367 B
Python
Raw Permalink Normal View History

from datetime import datetime, time
class Timer():
def __init__(self):
self.startTime = 0
def has_second_passed(self):
return self.get_time() > 1
def get_time(self):
return str(datetime.now() - self.startTime)
def reset_time(self):
self.startTime = datetime.now()