C linux equivalent of windows QueryPerformanceCounter C linux equivalent of windows QueryPerformanceCounter linux linux

C linux equivalent of windows QueryPerformanceCounter


clock_gettime(2), with an argument of CLOCK_REALTIME_HR.


clock_gettime() with CLOCK_MONOTONIC_RAW


The HAVEGE library uses the CPU counter. Check out its source code here. The relevant file is src/hardtick.h.