Normally QueryPerformanceCounter and QueryPerformanceFrequency is used to get the accurate time of an operation.
QueryPerformanceCounter() provides current value of the high resolution timer.
and
QueryPerformanceFrequency returns the current performance-counter frequency, in counts per second.
Both of these function provides information of high-resolution performance counters in the system.
qpcFlag = (QueryPerformanceFrequency((LARGE_INTEGER*)&time) > 0);
if (qpcFlag) qpcFrequency = 1000.0 / time;
Here
qpcFlag
indicates the presence of a High resolution timer in your machine.
time
is the counts per second of High Resolution Timer. Therefore
qpcFrequency
is the frequency in milliseconds.
An example of measuring time of an operation.
QueryPerformanceCounter( &StartTime );
..
QueryPerformanceCounter( &EndTime );
After that you can measure the time of Processing in milliseconds by the following code.
double fTime = (double)((EndTime.QuadPart - StartTime.QuadPart ) * qpcFrequency );
Details of QPC and QPF
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx[
^]
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx[
^]