Vitus
Resource contributor
- Messages
- 1,480
- Country

Gentleman,
my C++ module needs a timer at various places. I found a solution for that months ago, but it's rather quick & dirty and most importantly it doesn't take slew, time compression or pause into account. Therefore I want to ask around how you solved this problem.
Here is my timer code:
cheers,
Vitus
my C++ module needs a timer at various places. I found a solution for that months ago, but it's rather quick & dirty and most importantly it doesn't take slew, time compression or pause into account. Therefore I want to ask around how you solved this problem.
Here is my timer code:
Code:
class cTimer{
private:
FLOAT64 m_OldTime;
FLOAT64 m_DeltaTime;
public:
cTimer(){}
~cTimer(){}
void FSAPI StartTimer() {
m_OldTime = timeGetTime();
}
double FSAPI GetDeltaTime() {
FLOAT64 NewTime = timeGetTime();
m_DeltaTime = NewTime - m_OldTime;
m_OldTime = NewTime;
return m_DeltaTime*0.001;
}
};
cheers,
Vitus
Last edited:

