mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpilib] Remove Timer lock in wpilibj and update docs (#3602)
Timer reports a negative duration if the sim timing is restarted. This can be worked around by calling Reset(). Other options included: 1. Have RestartTiming() call Timer::Reset() on a list of instantiated Timers. 2. Have Timer::Get() reset the timer if it notices time went backwards. This requires dropping const qualification though, which is a breaking change that only fixes a minor edge case. Closes #2732.
This commit is contained in:
@@ -29,7 +29,10 @@ void Wait(units::second_t seconds);
|
||||
units::second_t GetTime();
|
||||
|
||||
/**
|
||||
* A wrapper for the frc::Timer class that returns unit-typed values.
|
||||
* A timer class.
|
||||
*
|
||||
* Note that if the user calls frc::sim::RestartTiming(), they should also reset
|
||||
* the timer so Get() won't return a negative duration.
|
||||
*/
|
||||
class Timer {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user