#pragma once #include #include #include #include #include #include #include class Timer { public: Timer(); ~Timer(); // Start timer void start(); // Stop timer void stop(); // Reset timer void reset(); // Get elapsed time in milliseconds int getElapsedTime() const; // Signal emitted on timer tick sigc::signal timerSignal; private: std::chrono::time_point m_startTime; std::atomic m_running; // Thread handling std::thread m_timerThread; std::mutex m_mutex; std::condition_variable m_condition; // Timer thread function void timerThread(); };