mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpiutil] Use steady_clock directly on SystemCore (#8053)
Don’t offset it from program start time. This will make it much easier to coordinate timestamps across the system. Closes #8041
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user