Clock.h 400 B

12345678910111213141516171819202122232425
  1. #ifndef CLOCK_H
  2. #define CLOCK_H
  3. #include <GLFW/glfw3.h>
  4. class Clock
  5. {
  6. public:
  7. Clock();
  8. Clock(const Clock& orig);
  9. virtual ~Clock();
  10. uint64_t getCurrentTime() const;
  11. void update();
  12. double getUpdatesPerSecond() const;
  13. private:
  14. static const int SIZE = 64;
  15. uint64_t oldTime = 0;
  16. uint64_t time[SIZE];
  17. uint64_t sum = 0;
  18. unsigned int index = 0;
  19. };
  20. #endif