Source code of Windows XP (NT5)
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.

42 lines
980 B

  1. /******************************Module*Header*******************************\
  2. * Module Name: util.hxx
  3. *
  4. * Utility classes
  5. *
  6. * Copyright (c) 1996 Microsoft Corporation
  7. *
  8. \**************************************************************************/
  9. #ifndef __util_hxx__
  10. #define __util_hxx__
  11. class SS_TIME {
  12. public:
  13. SS_TIME() { Zero(); };
  14. double Seconds();
  15. void Update();
  16. void Zero();
  17. SS_TIME operator+( SS_TIME addTime );
  18. SS_TIME operator-( SS_TIME subTime );
  19. SS_TIME operator+=( SS_TIME addTime );
  20. SS_TIME operator-=( SS_TIME subTime );
  21. operator double() { return seconds; };
  22. operator float() { return (float) seconds; };
  23. operator int() { return (int) (seconds + 0.5); };
  24. private:
  25. double seconds;
  26. };
  27. class SS_TIMER {
  28. public:
  29. SS_TIMER() { Reset(); };
  30. void Start();
  31. SS_TIME Stop();
  32. void Reset();
  33. SS_TIME ElapsedTime();
  34. private:
  35. SS_TIME startTime;
  36. SS_TIME elapsed;
  37. };
  38. #endif // __util_hxx__