Monotonic clocks
A monotonic clock is a time source that won’t ever jump forward or backward (due to NTP or Daylight Savings Time updates). To measure durations, we must use monotonic clocks. C++: std::chrono::steady_clock C/POSIX: clock_gettime(CLOCK_MONOTONIC, &t); Java: System.nanoTime .NET: System.Diagnostics.Stopwatch Rust: std::time::Instant Ruby Process.clock_gettime(Process::CLOCK_MONOTONIC) Python: time.monotonic Perl: Time::HiRes::clock_gettime(Time::HiRes::CLOCK_MONOTONIC) PHP: hrtime(true) Javascript: performance.now() https://stackoverflow.com/questions/3523442/difference-between-clock-realtime-and-clock-monotonic https://lobste.rs/s/uzjmam/mon_stupid_simple_monitoring#c_m6je8w