Files
hwr2023_a/GDP/D3D11/Time.cpp
T
2025-12-03 15:50:25 +01:00

35 lines
572 B
C++

#include "Time.h"
#include <string>
UINT Time::init()
{
_lastTime = CLOCK::now();
return 0;
}
void Time::update()
{
TIME_POINT now = CLOCK::now();
SECONDS diff = now - _lastTime;
_deltaTime = diff.count();
_lastTime = now;
#ifdef _DEBUG
#ifdef UNICODE
wstring output = L"fps: " + to_wstring(1 / _deltaTime) + L"\n";
OutputDebugString(output.c_str());
#else // !UNICODE
string output = "fps: " + to_string(1 / _deltaTime) + "\n";
OutputDebugString(output.c_str());
#endif // UNICODE
#endif // DEBUG
}
void Time::deInit()
{
}