Timer.pkg 824 B

1234567891011121314151617181920212223242526272829303132
  1. $#include "Timer.h"
  2. /// Low-resolution operating system timer.
  3. class Timer
  4. {
  5. public:
  6. /// Construct. Get the starting clock value.
  7. Timer();
  8. /// Return elapsed milliseconds and optionally reset.
  9. unsigned GetMSec(bool reset);
  10. /// Reset the timer.
  11. void Reset();
  12. };
  13. /// %Time and frame counter subsystem.
  14. class Time : public Object
  15. {
  16. public:
  17. /// Return frame number, starting from 1 once BeginFrame() is called for the first time.
  18. unsigned GetFrameNumber() const;
  19. /// Return current frame timestep as seconds.
  20. float GetTimeStep() const;
  21. /// Return current low-resolution timer period in milliseconds.
  22. unsigned GetTimerPeriod();
  23. /// Return elapsed time from program start as seconds.
  24. float GetElapsedTime();
  25. };