X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FTimer.h;h=d744fe09966cc203e76982695a1824e05946ed14;hb=c33724dc441c5b21a4eb84aa0105c95e82a66adc;hp=7e15952464057c61953653de28026afb8edb1f97;hpb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;p=l2e.git diff --git a/src/app/Timer.h b/src/app/Timer.h index 7e15952..d744fe0 100644 --- a/src/app/Timer.h +++ b/src/app/Timer.h @@ -68,6 +68,18 @@ public: Time Remaining() const { return data ? (data->target - data->time) : Time(); } + /// Time from start to hit. + Time TargetTime() const { + return data ? data->target : Time(); + } + /// Get the elapsed time since the timer started or last hit. + Time IterationElapsed() const { + return data ? data->time % data->target : Time(); + } + /// Get the remaining time in this iteration. + Time IterationRemaining() const { + return TargetTime() - IterationElapsed(); + } /// Get the iteration index for interval timers. int Iteration() const { return (data && data->target > Time()) ? std::floor(data->time / data->target) : Time(); @@ -155,4 +167,4 @@ private: } -#endif /* APP_TIMER_H_ */ +#endif