Why does std::chrono::system_clock::now() move backwards inside a running C++ program on some Linux systems?
Summary std::chrono::system_clock can move backwards on Linux because it reflects the system’s real-time clock, which can be adjusted by NTP or other time-correction mechanisms. When the OS steps the clock backward, your process observes that jump. It is not monotonic and never guaranteed to be. For monotonic timestamps, use std::chrono::steady_clock. Root Cause The backward time … Read more