isle/LEGO1/mxtimer.h
2023-06-14 01:22:42 +01:00

31 lines
497 B
C++

#ifndef MXTIMER_H
#define MXTIMER_H
#include "mxcore.h"
class MxTimer : public MxCore
{
public:
MxTimer();
void Start();
void Stop();
__declspec(dllexport) long GetRealTime();
long GetTime() inline
{
if (this->m_isRunning)
return s_LastTimeCalculated;
else
return s_LastTimeCalculated - this->m_startTime;
}
private:
long m_startTime;
MxBool m_isRunning;
static long s_LastTimeCalculated;
static long s_LastTimeTimerStarted;
};
#endif // MXTIMER_H