queryperformancecounter专题

精度试验结果报告Sleep, GetTickCount, timeGetTime, QueryPerformanceCounter

一段简单的代码来实现精度试验 int main() {       // 初始化代码       ......       int i = 0;       while(i++ < 1000)       {              // 获取时间代码              ......              printf(...);

QueryPerformanceCounter计算时间

QueryPerformanceCounter()这个函数返回高精确度性能计数器的值,它可以以微妙为单位计时. 计算时间的公式: double time=(nStopCounter.QuadPart-nStartCounter.QuadPart)/frequency.QuadPart 这两个函数是VC提供的仅供Windows 95及其后续版本使用的精确时间函数,并要求计算机从硬件上支持精确定