Skip to content

Commit

Permalink
Add measure getter
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Nov 15, 2024
1 parent 637a61d commit 5fd17bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ public static long getTime() {
return m_timeSource.getAsLong();
}

/**
* Read the microsecond timestamp. By default, the time is based on the FPGA hardware clock in
* microseconds since the FPGA started. However, the return value of this method may be modified
* to use any time base, including non-monotonic and non-continuous time bases.
*
* @return The current time in a measure.
*/
public static Time getMeasureTime() {
return Microseconds.of(m_timeSource.getAsLong());
}

/**
* Read the microsecond timer from the FPGA.
*
Expand Down

0 comments on commit 5fd17bb

Please sign in to comment.