1 /* $Id: perfcnt.c,v 1.2 2002/09/07 15:12:10 chorns Exp $
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/perfcnt.c
6 * PURPOSE: Performance counter functions
7 * PROGRAMMER: David Welch (welch@mcmail.com)
8 * Eric Kohl (ekohl@rz-online.de)
14 /* INCLUDES ***************************************************************/
19 #include <internal/debug.h>
22 /* FUNCTIONS **************************************************************/
26 HalCalibratePerformanceCounter(ULONG Count
)
30 /* save flags and disable interrupts */
34 for (i
= 0; i
< Count
; i
++);
42 KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq
)
44 * FUNCTION: Queries the finest grained running count avaiable in the system
46 * PerformanceFreq (OUT) = The routine stores the number of
47 * performance counters tick per second here
48 * RETURNS: The performance counter value in HERTZ
49 * NOTE: Returns the system tick count or the time-stamp on the pentium
52 if (PerformanceFreq
!= NULL
)
54 PerformanceFreq
->QuadPart
= 0;
55 return *PerformanceFreq
;