CElapsedTimer.h 275 B

123456789101112131415161718
  1. #pragma once
  2. #include <sys/time.h>
  3. class CElapsedTimer {
  4. public:
  5. CElapsedTimer() {}
  6. bool is_valid() const { return m_valid; }
  7. void start();
  8. int elapsed() const;
  9. private:
  10. bool m_valid { false };
  11. struct timeval m_start_time {
  12. 0, 0
  13. };
  14. };