Initial Commit

This commit is contained in:
2018-12-18 12:07:12 +01:00
commit 7ad040c6c1
31 changed files with 1974 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef UTIL_TIMER_H
#define UTIL_TIMER_H
#include <atomic>
#include <functional>
#include <thread>
namespace PresenceDetection {
namespace Util {
class Timer
{
public:
Timer();
~Timer();
void Start(int interval, std::function<void(void)> func);
void Stop();
bool IsRunning() const noexcept;
void Wait();
private:
std::atomic<bool> m_run;
std::thread m_thread;
};
} // namespace Util
} // namespace PresenceDetection
#endif // UTIL_TIMER_H