lego1: implement MxTimer + dependencies

This commit is contained in:
Thomas May
2023-06-14 01:22:42 +01:00
parent 0827ca8040
commit a925aec046
16 changed files with 296 additions and 9 deletions

View File

@@ -1,10 +1,31 @@
#ifndef MXTIMER_H
#define MXTIMER_H
class MxTimer
#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