what you need is
void delaySeconds( float seconds )
{
__int64 timeEllapsed;
__int64 timeStart;
__int64 timeDelta;
QueryPerformanceFrequency( (LARGE_INTEGER*)(&timeDelta ) );
QueryPerformanceCounter ( (LARGE_INTEGER*)(&timeStart ) );
__int64 timeToWait = (double)timeDelta * (double)seconds;
timeEllapsed = timeStart;
while( ( timeEllapsed - timeStart ) < timeToWait )
{
QueryPerformanceCounter( (LARGE_INTEGER*)(&timeEllapsed ) );
};
}
void delayMiliSeconds( float miliseconds )
{
__int64 timeEllapsed;
__int64 timeStart;
__int64 timeDelta;
QueryPerformanceFrequency( (LARGE_INTEGER*)(&timeDelta ) );
__int64 timeToWait = (double)timeDelta * (double)miliseconds/1000.0f;
QueryPerformanceCounter ( (LARGE_INTEGER*)(&timeStart ) );
timeEllapsed = timeStart;
while( ( timeEllapsed - timeStart ) < timeToWait )
{
QueryPerformanceCounter( (LARGE_INTEGER*)(&timeEllapsed ) );
};
}
void delayMicroSeconds( float microseconds )
{
__int64 timeEllapsed;
__int64 timeStart;
__int64 timeDelta;
QueryPerformanceFrequency( (LARGE_INTEGER*)(&timeDelta ) );
__int64 timeToWait = (double)timeDelta * (double)microseconds / 1000000.0f;
QueryPerformanceCounter ( (LARGE_INTEGER*)(&timeStart ) );
timeEllapsed = timeStart;
while( ( timeEllapsed - timeStart ) < timeToWait )
{
QueryPerformanceCounter( (LARGE_INTEGER*)(&timeEllapsed ) );
};
}