Class MockTimer

java.lang.Object
edu.wpi.first.wpilibj.MockTimer
All Implemented Interfaces:
XSettableTimerImpl, XTimerImpl

@Singleton public class MockTimer extends Object implements XSettableTimerImpl
  • 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 interface XSettableTimerImpl
      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 interface XSettableTimerImpl
      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 interface XTimerImpl
      Returns:
      Robot running time in seconds.
    • getMatchTime

      public double getMatchTime()
      Specified by:
      getMatchTime in interface XTimerImpl
    • delay

      public void delay(double seconds)
      Specified by:
      delay in interface XTimerImpl