精确延时函数DelayTime

void DelayTime(DWORD dwMilliseconds)
{
LARGE_INTEGER littmp;
LONGLONG lTimeBegin;
LONGLONG lTimeEnd;
double dMinus;
double dFreq;
double dTim;
QueryPerformanceFrequency(&littmp);
dFreq=(double)littmp.QuadPart;
QueryPerformanceCounter(&littmp);
lTimeBegin=littmp.QuadPart;
do 
{
QueryPerformanceCounter(&littmp);
lTimeEnd=littmp.QuadPart;
dMinus=(double)(lTimeEnd-lTimeBegin);
dTim=dMinus/dFreq;
} while (dTim<dwMilliseconds*0.001);
}

你可能感兴趣的:(Integer)