#ifdef _MSC_VER
#include <Windows.h>
#endif
 
LARGE_INTEGER t1, t2, freq;
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&t1);
QueryPerformanceCounter(&t2);
 
 double elapsedMillis = (t2.QuadPart - t1.QuadPart) / (double)freq.QuadPart;