Tuesday, 13 May 2014

How to find the frequency of processor on WinXP

The header file #include is used in windows platform
Declare the variable freq of type large 
 LARGE_INTEGER freq;

call the function
QueryPerformanceFrequency(&freq);

print the value of freq

This will get you the frequency of you CPU

Code:
#include
#include
#include
int main()
{
  LARGE_INTEGER freq;
  QueryPerformanceFrequency(&freq);
  cout << "The resolution of this timer is: " << freq.QuadPart << " Hz." <  getch();
}

No comments:

Post a Comment