2013-04-17 21:09:55 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2012-10-03 21:41:02 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2012-10-03 21:41:02 -06:00
|
|
|
|
2014-07-13 05:04:25 -06:00
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
#include "Common/Timer.h"
|
|
|
|
|
|
|
|
class FPSCounter
|
2014-07-02 18:19:08 -06:00
|
|
|
{
|
2014-07-13 05:04:25 -06:00
|
|
|
public:
|
|
|
|
unsigned int m_fps;
|
|
|
|
|
|
|
|
// Initializes the FPS counter.
|
|
|
|
FPSCounter();
|
|
|
|
|
|
|
|
// Called when a frame is rendered. Returns the value to be displayed on
|
|
|
|
// screen as the FPS counter (updated every second).
|
|
|
|
int Update();
|
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int m_counter;
|
|
|
|
unsigned int m_fps_last_counter;
|
|
|
|
Common::Timer m_update_time;
|
2012-10-03 21:41:02 -06:00
|
|
|
|
2014-07-13 05:04:25 -06:00
|
|
|
Common::Timer m_render_time;
|
|
|
|
std::ofstream m_bench_file;
|
2014-07-09 14:30:34 -06:00
|
|
|
|
2014-07-13 05:04:25 -06:00
|
|
|
void LogRenderTimeToFile(u64 val);
|
|
|
|
};
|