11 #include "HAL/cpp/priority_mutex.h"
15 typedef void (*TimerInterruptHandler)(
void* param);
17 void Wait(
double seconds);
32 virtual ~
Timer() =
default;
44 static double GetPPCTimestamp();
48 static const double kRolloverTime;
51 double m_startTime = 0.0;
52 double m_accumulatedTime = 0.0;
53 bool m_running =
false;
void Start()
Start the timer running.
Definition: Timer.cpp:117
Timer()
Create a new timer object.
Definition: Timer.cpp:65
void Reset()
Reset the timer by setting the time to 0.
Definition: Timer.cpp:105
Timer objects measure accumulated time in seconds.
Definition: Timer.h:29
double Get() const
Get the current time from the timer.
Definition: Timer.cpp:78
static double GetFPGATimestamp()
Return the FPGA system clock time in seconds.
Definition: Timer.cpp:169
void Stop()
Stop the timer.
Definition: Timer.cpp:132
Definition: priority_mutex.h:57
bool HasPeriodPassed(double period)
Check if the period specified has passed and if it has, advance the start time by that period...
Definition: Timer.cpp:150
static double GetMatchTime()
Return the approximate match time The FMS does not currently send the official match time to the robo...
Definition: Timer.cpp:188