mirror of
https://github.com/flightlessmango/MangoHud.git
synced 2024-11-11 19:10:55 +00:00
fpsmetrics: refactor FPS calculation in metrics
Co-authored-by: Etaash Mathamsetty <etaash.mathamsetty@gmail.com>
This commit is contained in:
parent
a6422bc6ff
commit
d102604291
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user