stimuli.time.BaseClock🔗
- class stimuli.time.BaseClock[source]🔗
Base class for high precision clocks.
If you want to implement a custom clock, you should subclass this class and define the abstract method
stimuli.time.BaseClock.get_time_ns()
which should return the time elapsed since instantiation in nanoseconds.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
- abstract get_time_ns()[source]🔗
Return the current time in nanoseconds.
- Returns:
- time
int
The current time in nanoseconds.
- time