mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
lego1: implement MxTimer + dependencies
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user