#ifndef TIMER_H #define TIMER_H #include #include #include #include #include class Timer { public: Timer(int interval_ms, std::function task); ~Timer(); void start(); void stop(); private: void run(); int interval; // Interval in milliseconds std::function task; std::atomic running; std::thread worker; }; #endif // TIMER_H