Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.633 kb
class Clock(object):
def __init__(self, time=None):
self._time = time
def increment(self, dt):
self.update(self.time() + dt)
return self.time()
def update(self, time):
if self._time is None:
self.start_time = time
self._time = time
def time(self):
if self._time is None:
return 0
return self._time
def has_run(self, duration):
""" checks if we've run as long as specified by the duration """
if self.time() - self.start_time > duration:
return True
return False
Jump to Line
Something went wrong with that request. Please try again.