|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.Timer
public class Timer
Timer objects measure accumulated time in milliseconds. The timer object functions like a stopwatch. It can be started, stopped, and cleared. When the timer is running its value counts up in milliseconds. When stopped, the timer holds the current value. The implementation simply records the time when started and subtracts the current time whenever the value is requested.
Constructor Summary | |
---|---|
Timer()
Create a new timer object. |
Method Summary | |
---|---|
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 long |
getUsClock()
Deprecated. Use getFPGATimestamp instead. |
void |
reset()
Reset the timer by setting the time to 0. |
void |
start()
Start the timer running. |
void |
stop()
Stop the timer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timer()
Method Detail |
---|
public static void delay(double seconds)
seconds
- Length of time to pausepublic static long getUsClock()
public static double getFPGATimestamp()
public double get()
public void reset()
public void start()
public void stop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |