Skip to content

Commit 84f4ff0

Browse files
committed
Update Timer.h
1 parent 9de1ad9 commit 84f4ff0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Timer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,10 @@ class RateTimer : public CDTimerClass
134134
this->Rate = rate;
135135
this->CDTimerClass::Start(rate);
136136
}
137+
138+
double GetRatePassed()
139+
{
140+
const int rate = this->Rate;
141+
return rate ? static_cast<double>(rate - this->GetTimeLeft()) / static_cast<double>(rate) : 1.0;
142+
}
137143
};

0 commit comments

Comments
 (0)