Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > DoxygenTestTimer.c
Go to the documentation of this file.
00001 #include <stdio.h> 00002 #include <conio.h> 00003 #include <windows.h> 00004 00005 void main ( int argc, char** argv, char** environ ) 00006 { 00007 LARGE_INTEGER liFrequency; 00008 LARGE_INTEGER liStartTime; 00009 LARGE_INTEGER liCurrentTime; 00010 00011 QueryPerformanceFrequency ( &liFrequency ); 00012 printf ( "HIGH RESOLUTION PERFOMANCE COUNTER Frequency = %I64d CLOCKS IN SECOND\n", 00013 liFrequency.QuadPart ); 00014 00015 00016 if (liFrequency.QuadPart == 0) 00017 { 00018 printf("Your computer does not support High Resolution Performance counter\n"); 00019 return; 00020 } 00021 00022 printf ( "Press <ENTER> to start test...\n" ); 00023 getchar(); 00024 00025 printf ( "\nPress any key to quit test\n\n" ); 00026 QueryPerformanceCounter ( &liStartTime ); 00027 for (;;) 00028 { 00029 QueryPerformanceCounter ( &liCurrentTime ); 00030 printf("Elapsed Time : %8.6f mSec\r", 00031 ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart)* (double)1000.0/(double)liFrequency.QuadPart )) ); 00032 if (_kbhit()) 00033 break; 00034 } 00035 00036 00037 } Generated on Sat May 26 2012 04:36:33 for ReactOS by
1.7.6.1
|