2006
02
15
16
47
Win APIs QueryPerformanceCounter() to do benchmark
LARGE_INTEGER Preciseness = { 1000000 };
LARGE_INTEGER frequency = { 0 };
LARGE_INTEGER startPerformanceCount;
LARGE_INTEGER endPerformanceCount;
inline void startProfiling()
{
QueryPerformanceFrequency(&frequency);
QueryPerformanceCounter(&startPerformanceCount);
}
inline __int64 endProfiling()
{
QueryPerformanceCounter(&endPerformanceCount);
return ((endPerformanceCount.QuadPart - startPerformanceCount.QuadPart)
* Preciseness.QuadPart / frequency.QuadPart);
}