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.
|
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).