double t0,t1; __int64 Freq = 0; __int64 Count = 0; if (QueryPerformanceFrequency((LARGE_INTEGER*)&Freq)&& Freq > 0&& QueryPerformanceCounter((LARGE_INTEGER*)&Count)){ t0=(double)Count / (double)Freq * 1000.0; } Sleep(1); if (QueryPerformanceFrequency((LARGE_INTEGER*)&Freq) && Freq > 0 && QueryPerformanceCounter((LARGE_INTEGER*)&Count)) { t1 = (double)Count / (double)Freq * 1000.0; }
TRACE(_T("Sleep=%.3lf "),t1-t0);