public class Timer extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Timer.Interface |
static interface |
Timer.StaticInterface |
Constructor and Description |
---|
Timer() |
Modifier and Type | Method and Description |
---|---|
static void |
delay(double seconds)
Pause the thread for a specified time.
|
double |
get()
Get the current time from the timer.
|
static double |
getFPGATimestamp()
Return the system clock time in seconds.
|
static double |
getMatchTime()
Return the approximate match time The FMS does not currently send the official match time to
the robots This returns the time since the enable signal sent from the Driver Station At the
beginning of autonomous, the time is reset to 0.0 seconds At the beginning of teleop, the time
is reset to +15.0 seconds If the robot is disabled, this returns 0.0 seconds Warning: This is
not an official time (so it cannot be used to argue with referees).
|
boolean |
hasPeriodPassed(double period)
Check if the period specified has passed and if it has, advance the start time by that period.
|
void |
reset()
Reset the timer by setting the time to 0.
|
static void |
SetImplementation(Timer.StaticInterface ti) |
void |
start()
Start the timer running.
|
void |
stop()
Stop the timer.
|
public Timer()
public static void SetImplementation(Timer.StaticInterface ti)
public static double getFPGATimestamp()
public static double getMatchTime()
public static void delay(double seconds)
seconds
- Length of time to pausepublic double get()
public void reset()
public void start()
public void stop()
public boolean hasPeriodPassed(double period)
period
- The period to check for (in seconds).