Timer#
Introduction#
The Timer in VEX GO allows you to track elapsed time and perform actions based on time intervals. With various methods for time management, you can create precise and timed operations within your program.
Below is a list of all methods:
Methods – Control and interact with the Brain’s timer.
reset – Resets the timer to zero.
time – Returns the elapsed time since the project started.
event – Calls a function after a specified number of milliseconds, with optional arguments.
Constructor – Create additional timers.
Timer – Creates an additional timer.
reset#
reset
sets the timer to zero.
Usage:
timer.reset()
Parameters |
Description |
---|---|
This method has no parameters. |
# Example coming soon
time#
time
returns the current elapsed time of the timer in the specified units — an integer for MSEC
or a float for SECONDS
.
Usage:
timer.time(units)
Parameters |
Description |
---|---|
|
The time units are milliseconds |
# Example coming soon
event#
event
calls a function after a specified amount of time.
Usage:
timer.event(callback, delay)
Parameters |
Description |
---|---|
|
A function to execute when the timer event occurs. |
|
The delay before the function is called, in milliseconds. |
# Example coming soon
Constructors#
Timer#
Timer
creates a new timer. A Timer
object will immediately begin counting the moment it is created and will work with all timer
methods.
Usage:
my_timer = Timer()
Parameters |
Description |
---|---|
This constructor has no parameters. |
# Example coming soon