10 #include <units/units.h>
11 #include <wpi/deprecated.h>
12 #include <wpi/mutex.h>
28 void Wait(units::second_t seconds);
50 virtual ~
Timer() =
default;
64 units::second_t
Get()
const;
147 static const units::second_t kRolloverTime;
150 units::second_t m_startTime = 0_s;
151 units::second_t m_accumulatedTime = 0_s;
152 bool m_running =
false;
153 mutable wpi::mutex m_mutex;
static units::second_t GetFPGATimestamp()
Return the FPGA system clock time in seconds.
units::second_t Get() const
Get the current time from the timer.
void Start()
Start the timer running.
void Stop()
Stop the timer.
A wrapper for the frc::Timer class that returns unit-typed values.
Definition: Timer.h:40
bool HasPeriodPassed(units::second_t period)
Check if the period specified has passed and if it has, advance the start time by that period.
static units::second_t GetMatchTime()
Return the approximate match time.
bool AdvanceIfElapsed(units::second_t 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.
double GetTime()
Gives real-time clock system time with nanosecond resolution.
bool HasElapsed(units::second_t period)
Check if the period specified has passed.
void Wait(double seconds)
Pause the task for a specified time.
Timer()
Create a new timer object.