Timer#
Timer.time()#
The Timer.time(units)
command returns the elapsed time.
This is a non-waiting command and allows the next command to run without delay.
Parameters |
Description |
---|---|
units |
Optional. A valid timeUnit. The default is |
Returns: The elapsed time in the specified unit.
Timer.clear()#
The Timer.clear()
command resets the timer value to 0.
This is a non-waiting command and allows the next command to run without delay.
Returns: None.
Timer.reset()#
The Timer.reset()
command resets the timer value.
This is a non-waiting command and allows the next command to run without delay.
Returns: None.
Timer.system()#
The Timer.system()
command returns the system time.
This is a non-waiting command and allows the next command to run without delay.
Returns: The system time in milliseconds.
Timer.systemHighResolution()#
The Timer.systemHighResolution()
command returns the high-resolution system time.
This is a non-waiting command and allows the next command to run without delay.
Returns: The high-resolution system time in milliseconds.
Timer.event()#
The Timer.event(callback, delay)
command registers a callback function for a timer event.
This is a waiting command and the next command will not run until the callback function finishes.
Parameters |
Description |
---|---|
callback |
The callback function to be called when the event occurs. |
delay |
The delay before the callback function is called. |
Returns: None.
Timer.value()#
The Timer.value()
command returns the current time in seconds.
This is a non-waiting command and allows the next command to run without delay.
Returns: The current time in seconds.