2023-04-27 22:19:39 -04:00
|
|
|
#ifndef MXTIMER_H
|
|
|
|
#define MXTIMER_H
|
|
|
|
|
2023-06-13 20:22:42 -04:00
|
|
|
#include "mxcore.h"
|
|
|
|
|
2023-06-29 04:10:08 -04:00
|
|
|
// VTABLE 0x100dc0e0
|
|
|
|
// SIZE 0x10
|
2023-06-13 20:22:42 -04:00
|
|
|
class MxTimer : public MxCore
|
2023-04-27 22:19:39 -04:00
|
|
|
{
|
|
|
|
public:
|
2023-06-13 20:22:42 -04:00
|
|
|
MxTimer();
|
|
|
|
|
|
|
|
void Start();
|
|
|
|
void Stop();
|
|
|
|
|
2023-07-02 04:05:49 -04:00
|
|
|
__declspec(dllexport) MxLong GetRealTime();
|
2023-06-13 20:22:42 -04:00
|
|
|
|
2023-07-02 04:05:49 -04:00
|
|
|
inline MxLong GetTime()
|
2023-06-13 20:22:42 -04:00
|
|
|
{
|
|
|
|
if (this->m_isRunning)
|
2023-07-07 14:00:48 -04:00
|
|
|
return s_LastTimeTimerStarted;
|
2023-06-13 20:22:42 -04:00
|
|
|
else
|
|
|
|
return s_LastTimeCalculated - this->m_startTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2023-07-02 04:05:49 -04:00
|
|
|
MxLong m_startTime;
|
2023-06-13 20:22:42 -04:00
|
|
|
MxBool m_isRunning;
|
2023-07-02 04:05:49 -04:00
|
|
|
static MxLong s_LastTimeCalculated;
|
|
|
|
static MxLong s_LastTimeTimerStarted;
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MXTIMER_H
|