-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimer.cpp
More file actions
41 lines (31 loc) · 1.36 KB
/
Timer.cpp
File metadata and controls
41 lines (31 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "Timer.h"
namespace RTE {
const std::string Timer::c_ClassName = "Timer";
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Timer::Clear() {
m_StartRealTime = g_TimerMan.GetRealTickCount();
m_StartSimTime = g_TimerMan.GetSimTickCount();
m_RealTimeLimit = -1;
m_SimTimeLimit = -1;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int Timer::Create() {
m_TicksPerMS = static_cast<double>(g_TimerMan.GetTicksPerSecond()) * 0.001;
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int Timer::Create(unsigned long elapsedSimTime) {
SetElapsedSimTimeMS(elapsedSimTime);
m_TicksPerMS = static_cast<double>(g_TimerMan.GetTicksPerSecond()) * 0.001;
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int Timer::Create(const Timer &reference) {
m_StartRealTime = reference.m_StartRealTime;
m_StartSimTime = reference.m_StartSimTime;
m_RealTimeLimit = reference.m_RealTimeLimit;
m_SimTimeLimit = reference.m_SimTimeLimit;
m_TicksPerMS = static_cast<double>(g_TimerMan.GetTicksPerSecond()) * 0.001;
return 0;
}
}