mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
New FrameTime/VBlank Analyzer + Graph
This commit is contained in:
40
Source/Core/VideoCommon/PerformanceMetrics.h
Normal file
40
Source/Core/VideoCommon/PerformanceMetrics.h
Normal file
@ -0,0 +1,40 @@
|
||||
// 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;
|
||||
|
||||
public: // Count Functions
|
||||
void Reset();
|
||||
void CountFrame();
|
||||
void CountVBlank();
|
||||
|
||||
public: // Getter Functions
|
||||
double GetFPS() const;
|
||||
double GetVPS() const;
|
||||
double GetSpeed() const;
|
||||
|
||||
double GetLastSpeedDenominator() const;
|
||||
|
||||
public: // ImGui Functions
|
||||
void DrawImGuiStats(const float backbuffer_scale) const;
|
||||
|
||||
private: // Member Variables
|
||||
PerformanceTracker m_fps_counter{"render_times.txt"};
|
||||
PerformanceTracker m_vps_counter{"vblank_times.txt"};
|
||||
PerformanceTracker m_speed_counter{nullptr, 6000000};
|
||||
};
|
||||
|
||||
extern PerformanceMetrics g_perf_metrics;
|
Reference in New Issue
Block a user