16 typedef void (*TimerInterruptHandler)(
void* param);
18 void Wait(
double seconds);
33 virtual ~
Timer() =
default;
45 static double GetPPCTimestamp();
49 static const double kRolloverTime;
52 double m_startTime = 0.0;
53 double m_accumulatedTime = 0.0;
54 bool m_running =
false;
55 mutable std::mutex m_mutex;
void Start()
Start the timer running.
Definition: Timer.cpp:121
Timer()
Create a new timer object.
Definition: Timer.cpp:69
void Reset()
Reset the timer by setting the time to 0.
Definition: Timer.cpp:109
Timer objects measure accumulated time in seconds.
Definition: Timer.h:30
double Get() const
Get the current time from the timer.
Definition: Timer.cpp:82
static double GetFPGATimestamp()
Return the FPGA system clock time in seconds.
Definition: Timer.cpp:173
void Stop()
Stop the timer.
Definition: Timer.cpp:136
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:154
static double GetMatchTime()
Return the approximate match time The FMS does not currently send the official match time to the robo...
Definition: Timer.cpp:192