C ++和Linux的高分辨率计时器? [英] High resolution timer with C++ and Linux?
本文介绍了C ++和Linux的高分辨率计时器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Windows下,有一些方便的函数,如 QueryPerformanceCounter
从 mmsystem.h
创建一个高分辨率定时器。
Linux上有类似的东西吗?
Under Windows there are some handy functions like QueryPerformanceCounter
from mmsystem.h
to create a high resolution timer.
Is there something similar for Linux?
推荐答案
这是在这之前问过 - 但基本上,有一个boost ptime函数可以使用,或POSIX clock_gettime()功能,可以基本上达到相同的目的。
It's been asked before here -- but basically, there is a boost ptime function you can use, or a POSIX clock_gettime() function which can serve basically the same purpose.
这篇关于C ++和Linux的高分辨率计时器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文