On Linux it can be argued that CLOCK_MONOTONIC_RAW should be used for durations. From the Linux man page:
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 adjustments or the incremental adjustments per‐
formed by adjtime(3). This clock does not count
time that the system is suspended.
There is also CLOCK_BOOTTIME to keep counting time while suspended:
CLOCK_BOOTTIME (since Linux 2.6.39; Linux-specific)
A nonsettable system-wide clock that is identical
to CLOCK_MONOTONIC, except that it also includes
any time that the system is suspended. This allows
applications to get a suspend-aware monotonic clock
without having to deal with the complications of
CLOCK_REALTIME, which may have discontinuities if
the time is changed using settimeofday(2) or simi‐
lar.
Beware, while CLOCK_MONOTONIC_RAW has its uses (avoiding clock skew due to NTP when you're synchronising to an external clock) wasn't vDSO'd yet and was slow AF (and causing a syscall...). It's been optimized on later kernels but I was on some RH or LTS branch I was badly bitten by this.
On Linux it can be argued that CLOCK_MONOTONIC_RAW should be used for durations. From the Linux man page:
There is also CLOCK_BOOTTIME to keep counting time while suspended: