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.

64 lines
987 B

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. timeseq.h
  5. Abstract:
  6. SIS Groveler time sequencer include file
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_TIMESEQ
  14. #define _INC_TIMESEQ
  15. #if TIME_SEQUENCE_VIRTUAL
  16. class TimeSequencer
  17. {
  18. public:
  19. static void VirtualSleep(
  20. unsigned int sleep_time);
  21. static unsigned int GetVirtualTickCount();
  22. private:
  23. TimeSequencer() {}
  24. ~TimeSequencer() {}
  25. static unsigned int virtual_time;
  26. };
  27. #define SLEEP(stime) TimeSequencer::VirtualSleep(stime)
  28. #define GET_TICK_COUNT() TimeSequencer::GetVirtualTickCount()
  29. #define WAIT_FOR_SINGLE_OBJECT(handle, timeout) \
  30. (TimeSequencer::VirtualSleep(timeout), WAIT_TIMEOUT)
  31. #else // TIME_SEQUENCE_VIRTUAL
  32. #define SLEEP(stime) Sleep(stime)
  33. #define GET_TICK_COUNT() GetTickCount()
  34. #define WAIT_FOR_SINGLE_OBJECT(handle, timeout) \
  35. WaitForSingleObject(handle, timeout)
  36. #endif // TIME_SEQUENCE_VIRTUAL
  37. #endif /* _INC_TIMESEQ */