From 0304f501412f618cc691f7e24350c2874bf615b9 Mon Sep 17 00:00:00 2001 From: Thad House Date: Fri, 4 Jul 2025 06:18:03 -0700 Subject: [PATCH] [wpiutil] Use steady_clock directly on SystemCore (#8053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t offset it from program start time. This will make it much easier to coordinate timestamps across the system. Closes #8041 --- wpiutil/src/main/native/cpp/timestamp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wpiutil/src/main/native/cpp/timestamp.cpp b/wpiutil/src/main/native/cpp/timestamp.cpp index 60efd83ef5..4dc352ae38 100644 --- a/wpiutil/src/main/native/cpp/timestamp.cpp +++ b/wpiutil/src/main/native/cpp/timestamp.cpp @@ -87,6 +87,9 @@ uint64_t wpi::NowDefault() { // delta by 1,000,000 uint64_t delta_in_us = delta * 1000000ull / frequency_val; return delta_in_us + zerotime_val; +#elif defined(__FRC_SYSTEMCORE__) + // We want clock synchronized across the system, so just use steady_clock. + return timestamp(); #else return zerotime_val + timestamp() - offset_val; #endif