Files
dolphin/Source/Core/VideoCommon/FPSCounter.h
T

32 lines
616 B
C++
Raw Normal View History

// Copyright 2008 Dolphin Emulator Project
2015-05-18 01:08:10 +02:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
2014-07-13 13:04:25 +02:00
#include <fstream>
#include "Common/Timer.h"
class FPSCounter
2014-07-02 20:19:08 -04:00
{
2014-07-13 13:04:25 +02:00
public:
// Initializes the FPS counter.
FPSCounter();
// Called when a frame is rendered (updated every second).
void Update();
2014-07-13 13:04:25 +02:00
unsigned int GetFPS() const { return m_fps; }
2014-07-13 13:04:25 +02:00
private:
unsigned int m_fps = 0;
unsigned int m_counter = 0;
unsigned int m_fps_last_counter = 0;
Common::Timer m_update_time;
2014-07-13 13:04:25 +02:00
Common::Timer m_render_time;
std::ofstream m_bench_file;
2014-07-13 13:04:25 +02:00
void LogRenderTimeToFile(u64 val);
2014-07-13 13:04:25 +02:00
};