LiquidFun
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
b2Timer.h
1 /*
2 * Copyright (c) 2011 Erin Catto http://box2d.org
3 * Copyright (c) 2014 Google, Inc.
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 * 2. Altered source versions must be plainly marked as such, and must not be
16 * misrepresented as being the original software.
17 * 3. This notice may not be removed or altered from any source distribution.
18 */
19 
20 #ifndef B2_TIMER_H
21 #define B2_TIMER_H
22 
24 
27 class b2Timer
28 {
29 public:
30 
32  b2Timer();
33 
35  void Reset();
36 
38  float32 GetMilliseconds() const;
39 
40 private:
42  static int64 GetTicks();
43 
44 #if defined(_WIN32)
45  static float64 s_invFrequency;
46 #endif
47  int64 m_start;
48 };
49 
50 #endif
void Reset()
Reset the timer.
Definition: b2Timer.cpp:125
Definition: b2Timer.h:27
float32 GetMilliseconds() const
Get the time since construction or the last reset.
Definition: b2Timer.cpp:129
b2Timer()
Constructor.
Definition: b2Timer.cpp:121