Linux下的精确计时函数
程序员文章站
2022-03-09 21:52:14
...
std::chrono::high_resolution_clock::time_point tnow = std::chrono::high_resolution_clock::now();
std::chrono::high_resolution_clock::time_point tpost = std::chrono::high_resolution_clock::now();
std::cout << "open camera cost time: " << std::chrono::duration_cast<std::chrono::duration<double>>(tpost - tnow).count() * 1000 << " ms" << std::endl;
目前确定的准确的计时函数,mark一下,基本上相机的库里面都是用的这个