As reported in D2726 there is currently an issue with random slowdowns and speedups with AMD Ryzen CPUs. The former patch took care of windows and this one is for linux.
According to StackOverflow
CLOCK_REALTIME represents the machine's best-guess as to the current wall-clock, time-of-day time. As Ignacio and MarkR say, this means that CLOCK_REALTIME can jump forwards and backwards as the system time-of-day clock is changed, including by NTP. CLOCK_MONOTONIC represents the absolute elapsed wall-clock time since some arbitrary, fixed point in the past. It isn't affected by changes in the system time-of-day clock. If you want to compute the elapsed time between two events observed on the one machine without an intervening reboot, CLOCK_MONOTONIC is the best option. Note that on Linux, CLOCK_MONOTONIC does not measure time spent in suspend, although by the POSIX definition it should. You can use the Linux-specific CLOCK_BOOTTIME for a monotonic clock that keeps running during suspend.
Since we only care about elapsed time, MONOTONIC should have been the initial choice. If supported, one might also want to use MONOTONIC_RAW
According to janwas:
yeah monotonic is better than realtime. there's also monotonic_raw which skips NTP freq adjustments, not sure that's better for long-running sessions.