00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef SHEEP_MISC_PENTIUMRTSC_H
00024 #define SHEEP_MISC_PENTIUMRTSC_H
00025
00026 #ifndef _MSC_VER
00027 #error This code is Intel Pentium (R) and Microsoft Visual C++ (R) specific.
00028 #endif // !_MSC_VER
00029
00030 #include "types.h"
00031
00032 #include <cassert>
00033
00034 namespace sheep {
00035
00036 class PentiumRTSC {
00037 public:
00038 PentiumRTSC();
00039
00040 void Start();
00041 void Stop();
00042
00043 int64 GetResult() const;
00044
00045 private:
00046 uint32 m_start_h, m_start_l;
00047 uint32 m_stop_h, m_stop_l;
00048
00049 int64 m_overhead;
00050 };
00051
00052 #include "pentiumrtsc.inl"
00053
00054 }
00055
00056 #endif // !SHEEP_MISC_PENTIUMRTSC_H