Understanding the different clocks of clock_gettime()
CLOCK_REALTIME reports the actual wall clock time. CLOCK_MONOTONIC is for measuring relative real time. It advances at the same rate as the actual flow of time but it’s not subject to discontinuities from manual or automatic (NTP) adjustments to the system clock. CLOCK_PROCESS_CPUTIME_ID is for measuring the amount of CPU time consumed by the process. … Read more