-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTimer.h
55 lines (46 loc) · 942 Bytes
/
Timer.h
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
/// @file
/// @author Kresimir Spes
/// @author Boris Mikic
/// @version 3.3
///
/// @section LICENSE
///
/// This program is free software; you can redistribute it and/or modify it under
/// the terms of the BSD license: http://www.opensource.org/licenses/bsd-license.php
///
/// @section DESCRIPTION
///
/// Defines a generic timer.
#ifndef APRIL_TIMER_H
#define APRIL_TIMER_H
#include <hltypes/hplatform.h>
#ifndef _WIN32
#include <stdint.h>
#define __int64 uint64_t
#endif
#include <stdio.h>
#include "aprilExport.h"
namespace april
{
class aprilExport Timer
{
public:
Timer();
~Timer();
float getTime();
float diff(bool update = true);
void update();
protected:
float dt;
float td;
float td2;
__int64 frequency;
float resolution;
__int64 mTimerStart;
unsigned long mTimerElapsed;
bool performanceTimer;
__int64 performanceTimerStart;
__int64 performanceTimerElapsed;
};
}
#endif