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.

51 lines
1.1 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: Perf.h
  3. *
  4. * Performance counter functions. Uses the Pentium performance counters
  5. * if they are available, otherwise falls back to the system QueryPerformance
  6. * api's.
  7. *
  8. * InitPerfCounter MUST be called before using the QUERY_PERFORMANCE_XXX macros
  9. * as it initializes the two global functions pointers.
  10. *
  11. *
  12. * Created: 13-10-95
  13. * Author: Stephen Estrop [StephenE]
  14. *
  15. * Copyright (c) 1995 Microsoft Corporation
  16. \**************************************************************************/
  17. #ifndef _PERF_
  18. #define _PERF_
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif /* __cplusplus */
  22. void
  23. InitPerfCounter(
  24. void
  25. );
  26. void
  27. QueryPerfCounter(
  28. LARGE_INTEGER *li
  29. );
  30. void
  31. QueryPerfFrequency(
  32. LARGE_INTEGER *li
  33. );
  34. typedef void (WINAPI* PERFFUNCTION)(LARGE_INTEGER *li);
  35. extern PERFFUNCTION lpQueryPerfCounter;
  36. extern PERFFUNCTION lpQueryPerfFreqency;
  37. #define QUERY_PERFORMANCE_FREQUENCY(x) (*lpQueryPerfFreqency)(x)
  38. #define QUERY_PERFORMANCE_COUNTER(x) (*lpQueryPerfCounter)(x)
  39. #ifdef __cplusplus
  40. }
  41. #endif /* __cplusplus */
  42. #endif /* !_PERF_ */