diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 19:54:38 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 19:54:38 +0100 |
| commit | 64ebfde8bcd6408e3b6925624e8680c314db6efc (patch) | |
| tree | b969314f909f7f16ef5acc63f90dca317a40850a /lib/nes/common/fps-counter.cc | |
| parent | d060e3a50c987d10799ccc739bdbf9d7d7a13c10 (diff) | |
get rid of nasty stdlib
Diffstat (limited to 'lib/nes/common/fps-counter.cc')
| -rw-r--r-- | lib/nes/common/fps-counter.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/nes/common/fps-counter.cc b/lib/nes/common/fps-counter.cc index ef6169b..8f19c7e 100644 --- a/lib/nes/common/fps-counter.cc +++ b/lib/nes/common/fps-counter.cc @@ -2,9 +2,9 @@ namespace nes { - auto fps_counter::frame(std::chrono::microseconds const elapsed_time) -> void + auto fps_counter::frame(u32 const elapsed_time_us) -> void { - if (elapsed_time.count() <= 0) { return; } + if (elapsed_time_us == 0) { return; } if (buffer_position_ == 0) { @@ -22,8 +22,7 @@ namespace nes } // Add the frame time to the buffer, replacing any existing content in the ring buffer. - auto const frame_time = static_cast<u32>(elapsed_time.count()); - frame_times_[buffer_position_] = frame_time; + frame_times_[buffer_position_] = elapsed_time_us; buffer_position_ = (buffer_position_ + 1) % buffer_size; } } // namespace nes
\ No newline at end of file |
