00001 #ifndef _HWTIMER_H_
00002 #define _HWTIMER_H_
00003
00004 #if defined(WIN32)
00005 #include <windows.h>
00006 #else
00007 #include <sys/time.h>
00008 #endif
00009
00019 class vuHWTimer
00020 {
00021 public:
00023
00026 vuHWTimer();
00028 vuHWTimer(const vuHWTimer& t);
00030 ~vuHWTimer();
00031
00033 vuHWTimer& operator=(const vuHWTimer& rhs);
00034
00036
00038 bool isSupported(void) const;
00039
00041
00045 float getElapsedTimeFloat(void);
00047
00051 double getElapsedTimeDouble(void);
00052
00053
00054
00055
00056
00057
00059
00064 void sleepFloat(float s);
00066
00071 void sleepDouble(double s);
00072
00073 private:
00074 #if defined(WIN32)
00075 LARGE_INTEGER m_LastCount;
00076 float m_FloatFreq;
00077 double m_DoubleFreq;
00078 #else
00079 struct timeval m_LastCount;
00080 #endif
00081 bool m_IsSupported;
00082 };
00083
00084 #endif