// Stopwatch.h: interface for the CStopwatch class. // ///////////////////////////////////////////////////////////////////// // in case of multiple includes, prevents multiple version from being // compiled #if !defined(STOPWATCH_H) #define STOPWATCH_H #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include class IStopwatch { public: // Utility functions virtual unsigned long __stdcall Release() = 0; // Stopwatch specific functions virtual HRESULT __stdcall Start() =0; virtual HRESULT __stdcall ElapsedTime(float *Time) =0; }; class CStopwatch : public IStopwatch { public: CStopwatch(); virtual ~CStopwatch(); private: // The frequency of the counter // returned by QueryPerformanceCounter() LARGE_INTEGER m_nFrequency; // The counter value when the start method was last called. LARGE_INTEGER m_nStartTime; public: // Utility functions unsigned long __stdcall Release(); // IStopwatch specific functions HRESULT __stdcall Start(); HRESULT __stdcall ElapsedTime(float *Time); }; #endif // !defined(STOPWATCH_H)