faster equivalent of gettimeofday
POSIX Clocks I wrote a benchmark for POSIX clock sources: time (s) => 3 cycles ftime (ms) => 54 cycles gettimeofday (us) => 42 cycles clock_gettime (ns) => 9 cycles (CLOCK_MONOTONIC_COARSE) clock_gettime (ns) => 9 cycles (CLOCK_REALTIME_COARSE) clock_gettime (ns) => 42 cycles (CLOCK_MONOTONIC) clock_gettime (ns) => 42 cycles (CLOCK_REALTIME) clock_gettime (ns) => 173 cycles (CLOCK_MONOTONIC_RAW) … Read more