mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal,wpilib] Rename FPGA clock to monotonic clock (#8672)
- Remove status return from HAL level (clock getting should never fail) - Remove 32-bit timestamp expand function - Make monotonic_clock.hpp (formerly fpga_clock.hpp) header-only and move to root hal include directory
This commit is contained in:
@@ -38,7 +38,7 @@ public class Tracer {
|
||||
|
||||
/** Restarts the epoch timer. */
|
||||
public final void resetTimer() {
|
||||
m_startTime = RobotController.getFPGATime();
|
||||
m_startTime = RobotController.getMonotonicTime();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ public class Tracer {
|
||||
* @param epochName The name to associate with the epoch.
|
||||
*/
|
||||
public void addEpoch(String epochName) {
|
||||
long currentTime = RobotController.getFPGATime();
|
||||
long currentTime = RobotController.getMonotonicTime();
|
||||
m_epochs.put(epochName, currentTime - m_startTime);
|
||||
m_startTime = currentTime;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class Tracer {
|
||||
* @param output the stream that the output is sent to
|
||||
*/
|
||||
public void printEpochs(Consumer<String> output) {
|
||||
long now = RobotController.getFPGATime();
|
||||
long now = RobotController.getMonotonicTime();
|
||||
if (now - m_lastEpochsPrintTime > kMinPrintPeriod) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
m_lastEpochsPrintTime = now;
|
||||
|
||||
Reference in New Issue
Block a user