ScummVM API documentation
te_real_timer.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TETRAEDGE_TE_TE_REAL_TIMER_H
23 #define TETRAEDGE_TE_TE_REAL_TIMER_H
24 
25 namespace Tetraedge {
26 
27 /* All times in microseconds. */
28 class TeRealTimer {
29 public:
30  TeRealTimer();
31 
32  uint64 getTimeFromStart();
33  void pause();
34  void start();
35  void stop();
36  uint64 systemTime();
37  uint64 monotonicSystemTime();
38  uint64 time_();
39  uint64 timeElapsed();
40  uint64 timeFromLastTimeElapsed();
41 
42  bool isPaused() const { return _paused; }
43 
44 private:
45  bool _paused;
46  uint64 _startTime;
47  uint64 _startTime2;
48  uint64 _pausedTime;
49  uint64 _maxTimeSeen;
50 
51 };
52 
53 } // end namespace Tetraedge
54 
55 #endif // TETRAEDGE_TE_TE_REAL_TIMER_H
Definition: detection.h:27
Definition: te_real_timer.h:28