Common: Create a PrecisionTimer class.

This commit is contained in:
Jordan Woyak
2025-03-14 18:16:39 -05:00
parent dadbd2f9fb
commit e5c8935acc
2 changed files with 90 additions and 2 deletions

View File

@ -5,6 +5,10 @@
#include "Common/CommonTypes.h"
#ifdef _WIN32
#include <Windows.h>
#endif
namespace Common
{
class Timer
@ -32,4 +36,21 @@ private:
bool m_running{false};
};
class PrecisionTimer
{
public:
PrecisionTimer();
~PrecisionTimer();
PrecisionTimer(const PrecisionTimer&) = delete;
PrecisionTimer& operator=(const PrecisionTimer&) = delete;
void SleepUntil(Clock::time_point);
private:
#ifdef _WIN32
HANDLE m_timer_handle;
#endif
};
} // Namespace Common