mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-22 15:37:55 -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
|