stimuli.time.Clock🔗
- class stimuli.time.Clock[source]🔗
Clock which keeps track of time in nanoseconds.
The origin
t=0corresponds to the instantiation of thestimuli.time.Clockobject. The time is measured either through the monotonictime.monotonic_ns()function or through the performance countertime.perf_counter()function, depending on which one has the highest resolution.Attributes
The time of instantiation of the clock in seconds.
Methods
get_time()Return the current time in seconds.
Return the current time in milliseconds.
Return the current time in nanoseconds.
Return the current time in microseconds.
reset()Reset the clock to zero.
- get_time()[source]🔗
Return the current time in seconds.
- Returns:
- time
float The current time in seconds.
- time
- get_time_ms()[source]🔗
Return the current time in milliseconds.
- Returns:
- time
float The current time in milliseconds.
- time
- get_time_ns()[source]🔗
Return the current time in nanoseconds.
- Returns:
- time
int The current time in nanoseconds.
- time