root/library/tests/unittest-cpp/Win32/TimeHelpers.h
@
477
Revision 477, 0.5 kB (checked in by mido, 15 years ago) |
---|
Rev | Line | |
---|---|---|
[418] | 1 | #ifndef UNITTEST_TIMEHELPERS_H |
2 | #define UNITTEST_TIMEHELPERS_H | |
3 | ||
4 | #include "../Config.h" | |
5 | ||
6 | ||
7 | #ifdef UNITTEST_MINGW | |
[477] | 8 | #ifndef __int64 |
9 | #define __int64 long long | |
[418] | 10 | #endif |
[477] | 11 | #endif |
[418] | 12 | |
13 | namespace UnitTest { | |
14 | ||
[477] | 15 | class Timer { |
[418] | 16 | public: |
[477] | 17 | Timer(); |
[418] | 18 | void Start(); |
[477] | 19 | double GetTimeInMs() const; |
[418] | 20 | |
21 | private: | |
[477] | 22 | __int64 GetTime() const; |
[418] | 23 | |
[477] | 24 | void* m_threadHandle; |
[418] | 25 | |
26 | #if defined(_WIN64) | |
[477] | 27 | unsigned __int64 m_processAffinityMask; |
[418] | 28 | #else |
[477] | 29 | unsigned long m_processAffinityMask; |
[418] | 30 | #endif |
31 | ||
32 | __int64 m_startTime; | |
33 | __int64 m_frequency; | |
34 | }; | |
35 | ||
36 | ||
[477] | 37 | namespace TimeHelpers { |
38 | void SleepMs ( int ms ); | |
[418] | 39 | } |
40 | ||
41 | ||
42 | } | |
43 | ||
44 | ||
45 | ||
46 | #endif |
Note: See TracBrowser
for help on using the browser.