isle-portable/LEGO1/mxtimer.h

32 lines
497 B
C
Raw Normal View History

2023-04-27 22:19:39 -04:00
#ifndef MXTIMER_H
#define MXTIMER_H
#include "mxcore.h"
class MxTimer : public MxCore
2023-04-27 22:19:39 -04:00
{
public:
MxTimer();
void Start();
void Stop();
2023-04-27 22:19:39 -04:00
__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;
2023-04-27 22:19:39 -04:00
};
#endif // MXTIMER_H