Package edu.wpi.first.wpilibj
Class MockTimer
java.lang.Object
edu.wpi.first.wpilibj.MockTimer
- All Implemented Interfaces:
XSettableTimerImpl
,XTimerImpl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
advanceTimeInSecondsBy
(double time) Advance the timervoid
delay
(double seconds) double
Return the system clock time in seconds.double
void
setTimeInSeconds
(double time) Set the current time
-
Constructor Details
-
MockTimer
@Inject public MockTimer()
-
-
Method Details
-
setTimeInSeconds
public void setTimeInSeconds(double time) Description copied from interface:XSettableTimerImpl
Set the current time- Specified by:
setTimeInSeconds
in interfaceXSettableTimerImpl
- Parameters:
time
- The current time in seconds
-
advanceTimeInSecondsBy
public void advanceTimeInSecondsBy(double time) Description copied from interface:XSettableTimerImpl
Advance the timer- Specified by:
advanceTimeInSecondsBy
in interfaceXSettableTimerImpl
- Parameters:
time
- Duration in seconds to advance by
-
getFPGATimestamp
public double getFPGATimestamp()Return the system clock time in seconds. Return the time from the FPGA hardware clock in seconds since the FPGA started.- Specified by:
getFPGATimestamp
in interfaceXTimerImpl
- Returns:
- Robot running time in seconds.
-
getMatchTime
public double getMatchTime()- Specified by:
getMatchTime
in interfaceXTimerImpl
-
delay
public void delay(double seconds) - Specified by:
delay
in interfaceXTimerImpl
-