36 Timer(
int timeout_ms);
47 void reset()
override;
53 bool isDone()
const override;
Interface for a timer class.
Definition: timer.hpp:10
virtual void reset()=0
Reset the timer to the current time.
virtual void setTimeout(int timeout_ms)=0
Set the timeout of the timer. Does not reset the timer.
virtual ~ITimer()=default
Destructor.
virtual void setDone()=0
Set the timer to be done. Changes the start time.
virtual bool isDone() const =0
Check if the timer has expired.
A software timer class for manual control.
Definition: timer.hpp:72
void setDone() override
Set the timer to done.
Definition: timer.hpp:93
void reset() override
Reset the timer - Sets the timer to not done.
Definition: timer.hpp:78
void setTimeout(int timeout_ms) override
Stubbed out - Does nothing.
Definition: timer.hpp:88
SoftwareTimer()=default
Default constructor.
bool isDone() const override
Check if the timer is done.
Definition: timer.hpp:83
void setNotDone()
Set the timer to not done.
Definition: timer.hpp:98
bool is_done_
The done state of the timer.
Definition: timer.hpp:104
A simple timer class for timing events.
Definition: timer.hpp:30
bool isDone() const override
Check if the timer has expired.
Definition: timer.cpp:18
void setDone() override
Set the timer to be done. Changes the start time.
Definition: timer.cpp:30
int timeout_ms_
Definition: timer.hpp:68
void setTimeout(int timeout_ms) override
Set the timeout of the timer.
Definition: timer.cpp:23
void reset() override
Reset the timer to the current time.
Definition: timer.cpp:14
Timer()
Create a new timer with a timeout of 0. Must call setTimeout before using.
Definition: timer.cpp:11
bst::clck::TimePoint start_
Definition: timer.hpp:67
std::chrono::time_point< Clock > TimePoint
Definition: clock.hpp:16
TimePoint now()
Definition: clock.hpp:19
Definition: filesystem.cpp:34