High resolution timer with C++ and Linux?

okoman picture okoman · Feb 11, 2009 · Viewed 79k times · Source

Under Windows there are some handy functions like QueryPerformanceCounter from mmsystem.h to create a high resolution timer. Is there something similar for Linux?

Answer

Nik Reiman picture Nik Reiman · Feb 11, 2009

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.