Skip to content

Commit

Permalink
fpsmetrics: refactor FPS calculation in metrics
Browse files Browse the repository at this point in the history
Co-authored-by: Etaash Mathamsetty <etaash.mathamsetty@gmail.com>
  • Loading branch information
flightlessmango and Etaash-mathamsetty committed Sep 4, 2024
1 parent a6422bc commit d102604
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fps_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class fpsMetrics {
if (!fps_stats.empty()) {
float sum = std::accumulate(fps_stats.begin(), fps_stats.end(), 0.0f,
[](float acc, const std::pair<uint64_t, float>& p) {
return acc + p.second;
return acc + 1000.f / p.second;
});
it->value = sum / fps_stats.size();
it->value = 1000.f / (sum / fps_stats.size());
}
} else {
try {
Expand Down

0 comments on commit d102604

Please sign in to comment.