Clock.h 364 B

123456789101112131415161718192021222324
  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. void update();
  11. double getUpdatesPerSecond() const;
  12. private:
  13. static const int SIZE = 256;
  14. uint64_t oldTime = 0;
  15. uint64_t time[SIZE];
  16. uint64_t sum = 0;
  17. unsigned int index = 0;
  18. };
  19. #endif