Measurement with boost::posix_time::microsec_clock has error more than ten microseconds?

前端 未结 2 1728
猫巷女王i
猫巷女王i 2021-01-13 01:41

I have the following code:

long long unsigned int GetCurrentTimestamp()
{
   LARGE_INTEGER res;
   QueryPerformanceCounter(&res);
   return res.QuadPart;         


        
2条回答
  •  梦谈多话
    2021-01-13 02:27

    Unfortunately current Boost implementation of boost::posix_time::microsec_clock doesn't uses QueryPerformanceCounter Win32 API, it uses GetSystemTimeAsFileTime instead which in its turn uses GetSystemTime. But system time resolution is milliseconds (or even worse).

提交回复
热议问题