5#include <condition_variable>
17 const std::chrono::microseconds cSpinWait{1};
20 std::unique_lock<std::mutex> mLock;
21 std::condition_variable mConditionVariable;
24 void delay(std::chrono::seconds duration);
35 void Start(std::chrono::seconds delayDuration);
A thread-safe countdown timer running on a different thread.
Definition: delay_timer.h:15
void Start(std::chrono::seconds delayDuration)
Start the timer if it has not been started yet.
Definition: delay_timer.cpp:20
bool IsActive() const noexcept
Indicate whether the timer is active or not.
Definition: delay_timer.cpp:33
void Dispose()
Release resources aquired by the timer.
Definition: delay_timer.cpp:38