VideoCommon: Improve precision of FPS counter

This commit is contained in:
Stenzek
2017-06-30 17:25:32 +10:00
parent 1fccbd5be3
commit 621287e7eb
3 changed files with 24 additions and 26 deletions

View File

@ -6,7 +6,7 @@
#include <fstream>
#include "Common/Timer.h"
#include "Common/CommonTypes.h"
class FPSCounter
{
@ -17,14 +17,12 @@ public:
// Called when a frame is rendered (updated every second).
void Update();
unsigned int GetFPS() const { return m_fps; }
float GetFPS() const { return m_fps; }
private:
unsigned int m_fps = 0;
unsigned int m_counter = 0;
unsigned int m_fps_last_counter = 0;
Common::Timer m_update_time;
Common::Timer m_render_time;
u64 m_last_time = 0;
u64 m_time_since_update = 0;
u32 m_frame_counter = 0;
float m_fps = 0;
std::ofstream m_bench_file;
void LogRenderTimeToFile(u64 val);