HighRezTimer.h 608 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef HIGH_REZ_TIMER_H
  2. #define HIGH_REZ_TIMER_H
  3. #include "util/StdTypes.h"
  4. /// High resolution timer. All time in seconds
  5. class HighRezTimer
  6. {
  7. public:
  8. /// The type that the timer manipulates the results
  9. typedef double Scalar;
  10. HighRezTimer();
  11. /// Start the timer
  12. void start();
  13. /// Stop the timer
  14. void stop();
  15. /// Get the time elapsed between start and stop (if its stopped) or
  16. /// between start and the current time
  17. Scalar getElapsedTime() const;
  18. /// Get the current date's seconds
  19. static Scalar getCrntTime();
  20. private:
  21. Scalar startTime;
  22. Scalar stopTime;
  23. };
  24. #endif