■
高分解能 経過時間の計測方法
#include "stdafx.h"
#include
#include
int _tmain(int argc, _TCHAR* argv[])
{
LARGE_INTEGER s,f,e;
QueryPerformanceFrequency(&f);
QueryPerformanceCounter(&s);
{
Sleep(1000); // 1sec
}
QueryPerformanceCounter(&e);
double duration =(((double )( e.QuadPart-s.QuadPart) / ( double)f.QuadPart));
std::wcout << duration << L"sec"; // ex. 0.999823sec
return 0;
}