b740e9b6d578850dc9aa8f7c52868d156984c04f
[GPU.git] / Chronos.h
1 #ifndef CHRONOS_H
2 #define CHRONOS_H
3
4 #include <string>
5
6 using std::string;
7 using std::ostream;
8
9 class Chronos
10 {
11 public:
12
13 /*--------------------------------------*\
14 |* Constructor *|
15 \*-------------------------------------*/
16
17 Chronos();
18
19 /*--------------------------------------*\
20 |* Destructor *|
21 \*-------------------------------------*/
22
23 virtual ~Chronos();
24
25 /*--------------------------------------*\
26 |* Methodes *|
27 \*-------------------------------------*/
28
29 void start();
30 double stop();
31 double timeFlight() const;
32 double getDeltaTime() const;
33 void print(const string& titre = "") const;
34 void print(ostream& stream, const string& titre = "") const;
35
36 /*--------------------------------------*\
37 |* Friend *|
38 \*-------------------------------------*/
39
40 friend ostream& operator <<(ostream& stream, const Chronos& chrono);
41
42 private:
43
44 /*--------------------------------------*\
45 |* Methodes *|
46 \*-------------------------------------*/
47
48 static double time();
49
50 /*--------------------------------------*\
51 |* Attributs *|
52 \*-------------------------------------*/
53
54 double timeStart;
55 double timeStop;
56 double deltaTime;
57 bool isRunning;
58 };
59
60 #endif