Thomas Sampson


Leave a comment

High Resolution Timer (snippet)

LARGE_INTEGER start, end, freq;
QueryPerformanceFrequency(&freq);

QueryPerformanceCounter(&start);
Sleep(1000);
QueryPerformanceCounter(&end);

double elapsedMilliseconds = (end.QuadPart - start.QuadPart) * 1000.0 / freq.QuadPart;
Advertisements