?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #ifndef UNITTEST_TIMEHELPERS_H
  2. #define UNITTEST_TIMEHELPERS_H
  3.  
  4. #include "../Config.h"
  5. #include "../HelperMacros.h"
  6.  
  7. #ifdef UNITTEST_MINGW
  8. #ifndef __int64
  9. #define __int64 long long
  10. #endif
  11. #endif
  12.  
  13. namespace UnitTest {
  14.  
  15.    class UNITTEST_LINKAGE Timer
  16.    {
  17.    public:
  18.       Timer();
  19.       void Start();
  20.       double GetTimeInMs() const;
  21.  
  22.    private:
  23.       __int64 GetTime() const;
  24.  
  25.       void* m_threadHandle;
  26.  
  27. #if defined(_WIN64)
  28.       unsigned __int64 m_processAffinityMask;
  29. #else
  30.       unsigned long m_processAffinityMask;
  31. #endif
  32.  
  33.       __int64 m_startTime;
  34.       __int64 m_frequency;
  35.    };
  36.  
  37.  
  38.    namespace TimeHelpers
  39.    {
  40.       UNITTEST_LINKAGE void SleepMs(int ms);
  41.    }
  42.  
  43. }
  44.  
  45. #endif
  46.