Time
Last updated
Last updated
Time plays a critical role in various aspects of robot design, programming, and competition strategy. The blocks in this section allow you to get high precision system time and calculate the elapsed time.
nanoTime
Return the current system time in nanoseconds.
ElapsedTime
Elapsed time simply refers to the amount of time that has passed between a starting point and an ending point. It's the duration of an event or the time it takes for something to happen.
new ElapsedTime
Returns an ElapsedTime object presenting a timer with SECONDS resolution, initialized with the current system time.
new ElapsedTime (startTime)
Returns an ElapsedTime object presenting a timer with SECONDS resolution, initialized with a given start time.
new ElapsedTime (resolution)
Create a new elapsed time object with a resolution of SECONDS or MILLISECONDS, initialized with the current system time.
StartTime
Returns the start time of the specified elapsed time object using the current resolution of the elapsed time object. Please note that the start time may be reset.
Time
Returns the duration that has elapsed since the last reset of the timer. The duration is a float number measured with the elapsed time object’s resolution - either SECONDS or MILLISECONDS.
Seconds
Returns the elapsed time in seconds since the last reset of the elapsed time object.
Milliseconds
Returns the elapsed time in milliseconds since the last reset of the elapsed time object.
Resolution
Returns the current resolution of the elapsed time object – either SECONDS or MILLISECONDS.
reset
Resets the specified elapsed time object. After reset, the start time is set to the current system time.
toText
Returns a text string giving the elapsed time of the elapsed time object. For example, “10.2500 milliseconds.”