the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "PerformanceTimer.h"
3
4PerformanceTimer::PerformanceTimer()
5{
6#ifndef _CONTENT_PACKAGE
7 // Get the frequency of the timer
8 LARGE_INTEGER qwTicksPerSec;
9 QueryPerformanceFrequency( &qwTicksPerSec );
10 m_fSecsPerTick = 1.0f / (float)qwTicksPerSec.QuadPart;
11
12 Reset();
13#endif
14}
15
16void PerformanceTimer::Reset()
17{
18#ifndef _CONTENT_PACKAGE
19 QueryPerformanceCounter( &m_qwStartTime );
20#endif
21}
22
23void PerformanceTimer::PrintElapsedTime(const wstring &description)
24{
25#ifndef _CONTENT_PACKAGE
26 LARGE_INTEGER qwNewTime, qwDeltaTime;
27
28 QueryPerformanceCounter( &qwNewTime );
29
30 qwDeltaTime.QuadPart = qwNewTime.QuadPart - m_qwStartTime.QuadPart;
31 float fElapsedTime = m_fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
32
33 app.DebugPrintf("TIMER: %ls: Elapsed time %f\n", description.c_str(), fElapsedTime);
34#endif
35}