Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / RigidBodyGpuPipeline / opencl / opengl_interop / btStopwatch.h
1 /*\r
2 Stopwatch for timing and profiling for the Bullet Physics Library, http://bulletphysics.org\r
3 Copyright (c) 2003-2011 Erwin Coumans\r
4 \r
5 This software is provided 'as-is', without any express or implied warranty.\r
6 In no event will the authors be held liable for any damages arising from the use of this software.\r
7 Permission is granted to anyone to use this software for any purpose, \r
8 including commercial applications, and to alter it and redistribute it freely, \r
9 subject to the following restrictions:\r
10 \r
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\r
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\r
13 3. This notice may not be removed or altered from any source distribution.\r
14 */\r
15 \r
16 #ifndef BT_STOPWATCH_H\r
17 #define BT_STOPWATCH_H\r
18 \r
19 ///The btStopwatch is a portable basic clock that measures real-time, use for profiling etc.\r
20 class btStopwatch\r
21 {\r
22 public:\r
23         btStopwatch();\r
24 \r
25         btStopwatch(const btStopwatch& other);\r
26         btStopwatch& operator=(const btStopwatch& other);\r
27 \r
28         ~btStopwatch();\r
29 \r
30         /// Resets the initial reference time.\r
31         void reset();\r
32 \r
33         /// Returns the time in ms since the last call to reset or since \r
34         /// the btStopwatch was created.\r
35         float getTimeMilliseconds();\r
36 \r
37         /// Returns the time in us since the last call to reset or since \r
38         /// the Clock was created.\r
39         unsigned long int getTimeMicroseconds();\r
40 private:\r
41         struct btStopwatchData* m_data;\r
42 };\r
43 \r
44 \r
45 #endif //BT_STOPWATCH_H