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.

89 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1991 - 1999
  6. //
  7. // File: time.hxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /* --------------------------------------------------------------------
  11. Microsoft OS/2 LAN Manager
  12. Copyright(c) Microsoft Corp., 1990
  13. -------------------------------------------------------------------- */
  14. /* --------------------------------------------------------------------
  15. File: time.hxx
  16. Description:
  17. This file provides a system independent high resolution timer package.
  18. History:
  19. stevez 08/13/91 First bits in bucket
  20. -------------------------------------------------------------------- */
  21. #ifndef __TIMER__
  22. #define __TIMER__
  23. #ifdef TIMERPC
  24. class TIMER
  25. {
  26. private:
  27. short hTimer; // high resolution timer handle
  28. short hTimerSecondary; // secondary timer
  29. unsigned long OverHeadSecondary; // overhead of secondary timer
  30. short UsedCount; // useage of the timer
  31. unsigned long TimeSlots[TIME_MAX]; // Array of timer slots
  32. public:
  33. TIMER() { Initial(); }
  34. void Initial()
  35. {
  36. UsedCount = 0;
  37. hTimer = -1;
  38. hTimerSecondary = -1;
  39. OverHeadSecondary = 0;
  40. }
  41. ~TIMER();
  42. short & RefCount() {return(UsedCount);}
  43. void ResetTime(void);
  44. void ResetTimeAux(void);
  45. unsigned long ReadTimeAux(void);
  46. void ChargeTime(TIME_SLOT Account);
  47. void ChargeTimeCalibrate(TIME_SLOT Account);
  48. unsigned long *GetTime(void)
  49. {
  50. return (TimeSlots);
  51. }
  52. friend void RPC_ENTRY _DoneTimeApi( char *, unsigned long *);
  53. friend void RPC_ENTRY _StartTimeApi(unsigned long *);
  54. };
  55. #else //TIMERPC
  56. class TIMER
  57. {
  58. private:
  59. static unsigned long TimeSlots[TIME_MAX];
  60. public:
  61. void ResetTime(void) {}
  62. void ChargeTime(TIME_SLOT Account) {(void) Account;}
  63. unsigned long * GetTime(void) {return (TimeSlots);}
  64. void Initial() {}
  65. };
  66. #endif //TIMERPC
  67. #endif // __TIMER__