-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCTimer.h
More file actions
57 lines (36 loc) · 838 Bytes
/
Copy pathCTimer.h
File metadata and controls
57 lines (36 loc) · 838 Bytes
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef CTIMER_H
#define CTIMER_H
//-----------------------------------------------------------------------
//
// Name: CTimer.h
//
// Author: Mat Buckland 2002
//
// Desc: Windows timer class
//
//-----------------------------------------------------------------------
#include <windows.h>
class CTimer
{
private:
LONGLONG m_CurrentTime,
m_LastTime,
m_NextTime,
m_FrameTime,
m_PerfCountFreq;
double m_TimeElapsed,
m_TimeScale;
float m_FPS;
public:
//ctors
CTimer();
CTimer(float fps);
//whatdayaknow, this starts the timer
void Start();
//determines if enough time has passed to move onto next frame
bool ReadyForNextFrame();
//only use this after a call to the above.
double GetTimeElapsed(){return m_TimeElapsed;}
double TimeElapsed();
};
#endif