mirror of
https://github.com/libretro/Mesen.git
synced 2024-11-30 20:40:54 +00:00
31 lines
484 B
C++
31 lines
484 B
C++
#include "stdafx.h"
|
|
|
|
#include <Windows.h>
|
|
#include "Timer.h"
|
|
|
|
Timer::Timer()
|
|
{
|
|
LARGE_INTEGER li;
|
|
if(!QueryPerformanceFrequency(&li)) {
|
|
throw;
|
|
}
|
|
|
|
_frequency = double(li.QuadPart) / 1000.0;
|
|
|
|
QueryPerformanceCounter(&li);
|
|
_start = li.QuadPart;
|
|
}
|
|
|
|
void Timer::Reset()
|
|
{
|
|
LARGE_INTEGER li;
|
|
QueryPerformanceCounter(&li);
|
|
_start = li.QuadPart;
|
|
}
|
|
|
|
double Timer::GetElapsedMS()
|
|
{
|
|
LARGE_INTEGER li;
|
|
QueryPerformanceCounter(&li);
|
|
return double(li.QuadPart - _start) / _frequency;
|
|
} |