__int64 i64Start;
__int64 i64End;
__int64 i64Overhead;
__int64 i64Frequency;
__int64 i64Elapsed;
const int iIterations = 100000;
int result;
QueryPerformanceCounter((LARGE_INTEGER*)&i64Start);
for (int i = 0; i < iIterations; ++i)
result = DummyTest();
//subtract overhead of the loop/function call, ..
QueryPerformanceCounter((LARGE_INTEGER*)&i64End);
QueryPerformanceCounter((LARGE_INTEGER*)&i64Start);
for (int i = 0; i < iIterations; ++i)
result = DoTest();
QueryPerformanceCounter((LARGE_INTEGER*)&i64End);
i64Elapsed = (i64End - i64Start) - i64Overhead;
QueryPerformanceFrequency((LARGE_INTEGER*)&i64Frequency);
std::cout << "Time elapsed was: " << (double)i64Elapsed /
(double)i64Frequency << " seconds" << std::endl;
looks cool to test the timing, huh!.