mirror of
https://github.com/libretro/MesenCE.git
synced 2026-11-10 03:02:05 -10:00
* Video: Add support for VRR when in borderless fullscreen mode (Windows only) and improve frame pacing * Fixed debug stats not disappearing when unchecking option in some scenarios * Changed frame pacing graph scale/logic to show the gap between the ideal pacing and the current pacing (within +/- 2ms)
25 lines
412 B
C++
25 lines
412 B
C++
#include "pch.h"
|
|
#include "Timer.h"
|
|
|
|
#include <thread>
|
|
#include <chrono>
|
|
|
|
using namespace std::chrono;
|
|
|
|
Timer::Timer()
|
|
{
|
|
Reset();
|
|
}
|
|
|
|
void Timer::Reset()
|
|
{
|
|
_start = high_resolution_clock::now();
|
|
}
|
|
|
|
double Timer::GetElapsedMS() const
|
|
{
|
|
high_resolution_clock::time_point end = high_resolution_clock::now();
|
|
duration<double> span = duration_cast<duration<double>>(end - _start);
|
|
return span.count() * 1000.0;
|
|
}
|