dolphin/Source/Core/VideoCommon/PerformanceMetrics.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.0 KiB
C
Raw Normal View History

2022-12-24 00:52:53 +00:00
// Copyright 2022 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "VideoCommon/PerformanceTracker.h"
class PerformanceMetrics
{
public:
PerformanceMetrics() = default;
~PerformanceMetrics() = default;
PerformanceMetrics(const PerformanceMetrics&) = delete;
PerformanceMetrics& operator=(const PerformanceMetrics&) = delete;
PerformanceMetrics(PerformanceMetrics&&) = delete;
PerformanceMetrics& operator=(PerformanceMetrics&&) = delete;
2022-12-24 01:13:01 +00:00
// Count Functions
2022-12-24 00:52:53 +00:00
void Reset();
void CountFrame();
void CountVBlank();
2022-12-24 01:13:01 +00:00
// Getter Functions
2022-12-24 00:52:53 +00:00
double GetFPS() const;
double GetVPS() const;
double GetSpeed() const;
double GetLastSpeedDenominator() const;
2022-12-24 01:13:01 +00:00
// ImGui Functions
2022-12-24 00:52:53 +00:00
void DrawImGuiStats(const float backbuffer_scale) const;
2022-12-24 01:13:01 +00:00
private:
2022-12-24 00:52:53 +00:00
PerformanceTracker m_fps_counter{"render_times.txt"};
PerformanceTracker m_vps_counter{"vblank_times.txt"};
PerformanceTracker m_speed_counter{std::nullopt, 500000};
2022-12-24 00:52:53 +00:00
};
extern PerformanceMetrics g_perf_metrics;