ReactOS
0.4.16-dev-2104-gb84fa49
TestTimer.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <conio.h>
3
#include <windows.h>
4
5
void
main
(
int
argc
,
char
**
argv
,
char
**
environ
)
6
{
7
LARGE_INTEGER
liFrequency;
8
LARGE_INTEGER
liStartTime;
9
LARGE_INTEGER
liCurrentTime;
10
11
QueryPerformanceFrequency
( &liFrequency );
12
printf
(
"HIGH RESOLUTION PERFOMANCE COUNTER Frequency = %I64d CLOCKS IN SECOND\n"
,
13
liFrequency.
QuadPart
);
14
15
16
if
(liFrequency.
QuadPart
== 0)
17
{
18
printf
(
"Your computer does not support High Resolution Performance counter\n"
);
19
return
;
20
}
21
22
printf
(
"Press <ENTER> to start test...\n"
);
23
getchar
();
24
25
printf
(
"\nPress any key to quit test\n\n"
);
26
QueryPerformanceCounter
( &liStartTime );
27
for
(;;)
28
{
29
QueryPerformanceCounter
( &liCurrentTime );
30
printf
(
"Elapsed Time : %8.6f mSec\r"
,
31
((
double
)( (liCurrentTime.
QuadPart
- liStartTime.
QuadPart
)* (
double
)1000.0/(
double
)liFrequency.
QuadPart
)) );
32
if
(
_kbhit
())
33
break
;
34
}
35
36
37
}
argc
static int argc
Definition:
ServiceArgs.c:12
QueryPerformanceFrequency
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition:
perfcnt.c:45
QueryPerformanceCounter
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition:
perfcnt.c:23
_kbhit
int CDECL _kbhit(void)
Definition:
console.c:474
getchar
int CDECL getchar(void)
Definition:
file.c:4813
environ
#define environ
Definition:
stdlib.h:285
main
int main()
Definition:
test.c:6
printf
#define printf
Definition:
freeldr.h:97
argv
#define argv
Definition:
mplay32.c:18
_LARGE_INTEGER
Definition:
typedefs.h:103
_LARGE_INTEGER::QuadPart
LONGLONG QuadPart
Definition:
typedefs.h:114
ntoskrnl
tests
TestTimer.c
Generated on Wed Jan 7 2026 06:12:49 for ReactOS by
1.9.6