#pragma once #include #include using namespace std::chrono_literals; using clock_type = std::chrono::high_resolution_clock; class Timer { public: Timer(std::chrono::milliseconds interval, bool cyclic); // connect to this signal boost::signals2::signal elapsed; void start(); void stop(); bool is_elapsed() const; void update(); private: std::chrono::time_point m_start_time; std::chrono::milliseconds m_interval; bool m_running; bool m_cyclic; };