-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTimeManager.hpp
More file actions
59 lines (48 loc) · 1.83 KB
/
Copy pathTimeManager.hpp
File metadata and controls
59 lines (48 loc) · 1.83 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#ifndef _TIME_MANAGER_H_
#define _TIME_MANAGER_H_
#ifdef WIN32 // Windows system specific
#include <windows.h>
#else // Unix based system specific
#include <sys/time.h>
#endif
namespace Geometry
{
class TimeManager
{
public:
/* =============================================================
* CTOR
* ============================================================= */
TimeManager ( );
/* =============================================================
* DTOR
* ============================================================= */
~TimeManager ( );
/* =============================================================
* PUBLIC FUNCTIONS
* ============================================================= */
void Start ( );
void Stop ( );
double GetElapsedTime ( ); // By default elapsed time is returned in seconds.
double GetElapsedTimeInSeconds ( ); // Returns elapsed time in seconds.
double GetElapsedTimeInMicroseconds ( ); // Returns elapsed time in microseconds.
double GetElapsedTimeInMilliseconds ( ); // Returns elapsed time in milliseconds.
private:
/* =============================================================
* MEMBERS
* ============================================================= */
double m_startTimeInMicroSeconds;
double m_endTimeInMicroSeconds;
int m_stopped;
#ifdef WIN32
LARGE_INTEGER m_frequency;
LARGE_INTEGER m_startCount;
LARGE_INTEGER m_endCount;
#else
timeval m_startCount;
timeval m_endCount;
#endif
};
}
#endif // _TIME_MANAGER_H_