File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,15 +30,19 @@ class CycleTimer {
3030
3131 auto target_cycle_time () const -> Duration { return target_; }
3232
33- static auto MakeAutoResetGuard (CycleTimer<Clock>& timer) {
34- return ScopeExit{[&timer] { timer.Reset (); }};
35- };
36-
37- static auto MakeFrameRateTimer (int target_fps) { return CycleTimer<Clock>{Duration{1000 / target_fps}}; }
38-
3933private:
4034 const Duration target_;
4135 details::StopwatchImpl<Clock> sw_{};
4236};
4337
38+ template <class Clock >
39+ auto MakeScopedCycleTimerReset (CycleTimer<Clock>& timer) {
40+ return ScopeExit{[&timer] { timer.Reset (); }};
41+ }
42+
43+ template <class Clock >
44+ auto MakeFrameRateTimer (int target_fps) {
45+ return CycleTimer<Clock>{typename CycleTimer<Clock>::Duration{1000 / target_fps}};
46+ }
47+
4448} // namespace oryx::chrono
You can’t perform that action at this time.
0 commit comments