精确获取系统时钟
2024-05-14
2
0
uint64_t get_timestamp1()
{
// struct timeval tm;
// gettimeofday(&tm, NULL);
// return (uint64_t)(tm.tv_sec*1000+tm.tv_usec/1000);
LARGE_INTEGER counter;
LARGE_INTEGER freq = { 0 };
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&counter);
return (counter.QuadPart * 1000) / (freq.QuadPart);
}