mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-29 19:16:05 -05:00
31 lines
497 B
C++
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
|