shadPS4/src/Lib/Timer.h

34 lines
679 B
C
Raw Normal View History

2023-06-29 12:17:05 +02:00
#pragma once
2023-07-07 12:49:46 +02:00
#include "../types.h"
2023-06-29 12:17:05 +02:00
namespace Lib {
class Timer final
{
public:
Timer();
~Timer() = default;
void Start();
void Pause();
void Resume();
bool IsPaused() const;
double GetTimeMsec() const;// return time in milliseconds
double GetTimeSec() const;// return time in seconds
u64 GetTicks() const;// return time in ticks
u64 GetFrequency() const;// return ticks frequency
public:
Timer(const Timer&) = delete;
Timer& operator=(const Timer&) = delete;
Timer(Timer&&) = delete;
Timer& operator=(Timer&&) = delete;
private:
bool m_is_timer_paused = true;
u64 m_Frequency = 0;
u64 m_StartTime = 0;
u64 m_PauseTime = 0;
};
}