CLOCK_REALTIME
System-wide clock that measures real (i.e., wall-clock) time.
Setting this clock requires appropriate privileges. This clock
is affected by discontinuous jumps in the system time (e.g., if
the system administrator manually changes the clock), and by the
incremental adjustments performed by
adjtime(3) and NTP.
CLOCK_REALTIME_COARSE (since Linux 2.6.32; Linux-specific)
A faster but less precise version of
CLOCK_REALTIME. Use when
you need very fast, but not fine-grained timestamps.
CLOCK_MONOTONIC
Clock that cannot be set and represents monotonic time
since some unspecified starting point. This clock is not
affected by discontinuous jumps in the system time (e.g.,
if the system administrator manually changes the clock),
but is affected by the incremental adjustments performed
by
adjtime(3) and NTP.
CLOCK_MONOTONIC_COARSE (since Linux 2.6.32; Linux-specific)
A faster but less precise version of
CLOCK_MONOTONIC.
Use when you need very fast, but not fine-grained time‐
stamps.
CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific)
Similar to
CLOCK_MONOTONIC, but provides access to a raw
hardware-based time that is not subject to NTP adjust‐
ments or the incremental adjustments performed by
adj‐
time(3).