timer.h 345 B

1234567891011121314151617181920212223242526
  1. #ifndef TIMER_H
  2. #define TIMER_H
  3. #include <chrono>
  4. #include <thread>
  5. namespace iv {
  6. class Timer{
  7. public:
  8. Timer(const float& hz);
  9. void Start();
  10. void Stop();
  11. private:
  12. std::chrono::duration<float> duration_;
  13. std::chrono::system_clock::time_point start_;
  14. std::chrono::duration<float> elapsed_;
  15. };
  16. }
  17. #endif // TIMER_H