def reset_stopwatch(self): """"Reset the stopwatch. The use of the stopwatch does not affect the clock time. """ self.__start = get_time()
def stopwatch_time(self): """Getter for time in milliseconds since last reset_stopwatch. The use of the stopwatch does not affect the clock time. """ return int((get_time() - self.__start) * 1000)
def __init__(self, sync_clock=None): """Create a clock. Parameters ---------- sync_clock : misc.Clock, optional synchronise clock with existing one """ if sync_clock.__class__.__name__ == "Clock": self.__init_time = sync_clock.init_time / 1000 else: self.__init_time = get_time() self._init_localtime = time.localtime() self.__start = get_time()
def __init__(self, sync_clock=None): """Create a clock. Parameters ---------- sync_clock : misc.Clock, optional synchronise clock with existing one """ if (sync_clock.__class__.__name__ == "Clock"): self.__init_time = sync_clock.init_time / 1000 else: self.__init_time = get_time() self._init_localtime = time.localtime() self.__start = get_time()
def time(self): """Getter for current time in milliseconds since clock init.""" return int((get_time() - self.__init_time) * 1000)
def monotonic_time(): """Returns the time of the high-resolution monitonoic timer that is used by Expyriment interally. """ return get_time()