Definition at line 4 of file fps_limiter.h.
◆ fps_limiter()
fps_limiter::fps_limiter |
( |
const float | target_fps = 60.0f | ) |
|
|
inlineexplicit |
Definition at line 6 of file fps_limiter.h.
7 : min_delta_(1.0f / target_fps), last_time_(std::chrono::high_resolution_clock::now()) {}
◆ should_run()
bool fps_limiter::should_run |
( |
| ) |
|
|
inline |
Definition at line 10 of file fps_limiter.h.
10 {
11 const auto now = std::chrono::high_resolution_clock::now();
12 if (const float elapsed = std::chrono::duration<float>(now - last_time_).count(); elapsed >= min_delta_) {
13 last_time_ = now;
14 return true;
15 }
16 return false;
17 }
The documentation for this class was generated from the following file: