edu.wpi.first.wpilibj.internal

## Class HardwareTimer

- java.lang.Object
- - edu.wpi.first.wpilibj.internal.HardwareTimer

- All Implemented Interfaces:
    Timer.StaticInterface

      public class HardwareTimer
      extends java.lang.Object
      implements Timer.StaticInterface

  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

    Constructors
    Constructor and Description
    `HardwareTimer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delay(double seconds)` Pause the thread for a specified time.
    `double` | `getFPGATimestamp()` Return the system clock time in seconds.
    `double` | `getMatchTime()`
    `Timer.Interface` | `newTimer()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HardwareTimer

          public HardwareTimer()

  - ### Method Detail

    - #### delay

          public void delay(double seconds)

      Pause the thread for a specified time. Pause the execution of the thread for a specified period of time given in seconds. Motors will continue to run at their last assigned values, and sensors will continue to update. Only the task containing the wait will pause until the wait time is expired.
      Specified by:
        `delay` in interface `Timer.StaticInterface`
      Parameters:
        `seconds` - Length of time to pause

    - #### 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 `Timer.StaticInterface`
      Returns:
        Robot running time in seconds.

    - #### getMatchTime

          public double getMatchTime()

      Specified by:
        `getMatchTime` in interface `Timer.StaticInterface`

    - #### newTimer

          public Timer.Interface newTimer()

      Specified by:
        `newTimer` in interface `Timer.StaticInterface`