00001 // ===================================================================== 00002 // $Id: TBenchmark.hh,v 1.2 2003/07/30 16:21:20 goiwai Exp $ 00003 // $Name: CLDAQ-1-08-01 $ 00004 // 00005 // $Log: TBenchmark.hh,v $ 00006 // Revision 1.2 2003/07/30 16:21:20 goiwai 00007 // ファイルにコミットログをつけることにしました. 00008 // 00009 // ===================================================================== 00010 #ifndef __TBENCHMARK_HH 00011 #define __TBENCHMARK_HH 00012 00013 #include "Tglobals.h" 00014 #include "TSystemTimer.hh" 00015 #include "TSystemClock.hh" 00016 00017 class TSystemTimer; 00018 class TSystemClock; 00019 00020 class TBenchmark 00021 { 00022 00023 protected: 00024 TSystemTimer theSystemTimer; 00025 TSystemClock theSystemClock; 00026 Tstring theStartTime; 00027 Tstring theStopTime; 00028 00029 public: 00030 TBenchmark( const Tstring& unit = Tsec ); 00031 virtual ~TBenchmark(); 00032 00033 public: 00034 virtual Tvoid Start(); 00035 virtual Tvoid Pause(); 00036 virtual Tvoid Stop(); 00037 virtual Tvoid Lap(); 00038 virtual Tvoid Restart(); 00039 virtual Tvoid Continue(); 00040 virtual Tvoid PrintResult(); 00041 00042 public: 00043 friend Tostream& operator<<( Tostream& tos, const TBenchmark& right ); 00044 00045 public: 00046 const TSystemTimer& GetSystemTimer() const; 00047 const TSystemClock& GetSystemClock() const; 00048 const Tstring& GetStartTime() const; 00049 const Tstring& GetStopTime() const; 00050 Tvoid SetStartTime( const Tstring& time ); 00051 Tvoid SetStopTime( const Tstring& time ); 00052 00053 }; 00054 00055 inline const TSystemTimer& TBenchmark::GetSystemTimer() const 00056 { 00057 return( theSystemTimer ); 00058 } 00059 00060 inline const TSystemClock& TBenchmark::GetSystemClock() const 00061 { 00062 return( theSystemClock ); 00063 } 00064 00065 inline const Tstring& TBenchmark::GetStartTime() const 00066 { 00067 return( theStartTime ); 00068 } 00069 00070 inline const Tstring& TBenchmark::GetStopTime() const 00071 { 00072 return( theStopTime ); 00073 } 00074 00075 inline Tvoid TBenchmark::SetStartTime( const Tstring& time ) 00076 { 00077 theStartTime = time; 00078 return; 00079 } 00080 00081 inline Tvoid TBenchmark::SetStopTime( const Tstring& time ) 00082 { 00083 theStopTime = time; 00084 return; 00085 } 00086 00087 #endif