mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Add Timer tests (#3595)
This commit is contained in:
@@ -63,7 +63,7 @@ void Timer::Stop() {
|
||||
}
|
||||
|
||||
bool Timer::HasElapsed(units::second_t period) const {
|
||||
return Get() > period;
|
||||
return Get() >= period;
|
||||
}
|
||||
|
||||
bool Timer::HasPeriodPassed(units::second_t period) {
|
||||
@@ -71,7 +71,7 @@ bool Timer::HasPeriodPassed(units::second_t period) {
|
||||
}
|
||||
|
||||
bool Timer::AdvanceIfElapsed(units::second_t period) {
|
||||
if (Get() > period) {
|
||||
if (Get() >= period) {
|
||||
// Advance the start time by the period.
|
||||
m_startTime += period;
|
||||
// Don't set it to the current time... we want to avoid drift.
|
||||
|
||||
Reference in New Issue
Block a user