Projekty z kursu Systemy operacyjne 2 na PWr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Stopwatch.h 477B

12345678910111213141516171819202122232425
  1. #ifndef STOPWATCH_H
  2. #define STOPWATCH_H
  3. #include <thread>
  4. #include <unistd.h>
  5. // Klasa do pomiaru czasu w oparciu o funkcje systemowe
  6. // Jan Potocki 2018
  7. class Stopwatch
  8. {
  9. public:
  10. Stopwatch();
  11. void start();
  12. void stop();
  13. bool isRunning();
  14. float read();
  15. protected:
  16. private:
  17. unsigned long long int miliseconds;
  18. bool running;
  19. std::thread measureThread;
  20. void measure();
  21. };
  22. #endif // STOPWATCH_H