From 64ebfde8bcd6408e3b6925624e8680c314db6efc Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 6 Feb 2025 19:54:38 +0100 Subject: get rid of nasty stdlib --- lib/nes/common/fps-counter.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/nes/common/fps-counter.cc') 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(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 -- cgit v1.3.1