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

33 lines
605 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();
unsigned int GetFPS() const { return m_fps; }
2014-07-13 13:04:25 +02:00
private:
2015-09-29 09:47:30 -04:00
unsigned int m_fps = 0;
unsigned int m_counter = 0;
unsigned int m_fps_last_counter = 0;
2014-07-13 13:04:25 +02:00
Common::Timer m_update_time;
Common::Timer m_render_time;
std::ofstream m_bench_file;
void LogRenderTimeToFile(u64 val);
};