edu.wpi.first.wpilibj

## Interface Timer.Interface

- Enclosing class:
    Timer

      public static interface Timer.Interface

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `get()` Get the current time from the timer.
    `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.
    `void` | `start()` Start the timer running.
    `void` | `stop()` Stop the timer.

- - ### Method Detail

    - #### get

          double get()

      Get the current time from the timer. If the clock is running it is derived from the current system clock the start time stored in the timer class. If the clock is not running, then return the time when it was last stopped.
      Returns:
        Current time value for this timer in seconds

    - #### reset

          void reset()

      Reset the timer by setting the time to 0. Make the timer startTime the current time so new requests will be relative now

    - #### start

          void start()

      Start the timer running. Just set the running flag to true indicating that all time requests should be relative to the system clock.

    - #### stop

          void stop()

      Stop the timer. This computes the time as of now and clears the running flag, causing all subsequent time requests to be read from the accumulated time rather than looking at the system clock.

    - #### hasPeriodPassed

          boolean hasPeriodPassed(double period)

      Check if the period specified has passed and if it has, advance the start time by that period. This is useful to decide if it's time to do periodic work without drifting later by the time it took to get around to checking.
      Parameters:
        `period` - The period to check for (in seconds).
      Returns:
        If the period has passed.