/*
CLOCK_MONOTONIC
Clock that cannot be set and represents monotonic time since
some unspecified starting point.
CLOCK_PROCESS_CPUTIME_ID
High-resolution per-process timer from the CPU.
CLOCK_THREAD_CPUTIME_ID
Thread-specific CPU-time clock.
*/
clock_gettime(CLOCK_MONOTONIC, &ts);
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
...