第1页共32页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第1页共32页精确获取时间(QueryPerformanceCounter)LARGE_INTEGERtima,timb;QueryPerformanceCounter(&tima);在WindowsServer2003和WindowsXP中使用QueryPerformanceCounter函数的程序可能执行不当QueryPerformanceCounter來精確計算執行時間QueryPerformanceCounter來精確計算執行時間//這個程式展示了如何使用QueryPerformanceCounter來精確計算執行時間//代码1
LARGE_INTEGERm_liPerfFreq={0};2
//获取每秒多少CPUPerformanceTick3
QueryPerformanceFrequency(&m_liPerfFreq);4
LARGE_INTEGERm_liPerfStart={0};6
QueryPerformanceCounter(&m_liPerfStart);7
for(inti=0;i