00001 // ===================================================================== 00002 // $Id: TBenchmark.cc,v 1.5 2004/03/07 10:30:34 goiwai Exp $ 00003 // $Name: CLDAQ-1-14-03 $ 00004 // $Log: TBenchmark.cc,v $ 00005 // Revision 1.5 2004/03/07 10:30:34 goiwai 00006 // ROOTに組みこむためのおまじないマクロを埋めこみました。 00007 // 全てにおいて完全に動作するわけではありません。 00008 // 00009 // Revision 1.4 2003/10/06 16:38:26 goiwai 00010 // *** empty log message *** 00011 // 00012 // Revision 1.3 2003/07/30 18:26:40 goiwai 00013 // operator<<()の出力がちょっと変更しました. 00014 // 00015 // Revision 1.2 2003/07/30 16:21:20 goiwai 00016 // ファイルにコミットログをつけることにしました. 00017 // 00018 // ===================================================================== 00019 #include "TBenchmark.hh" 00020 00021 TBenchmark::TBenchmark( const Tstring& unit ) 00022 : theSystemTimer( unit ), theSystemClock(), theStartTime(), theStopTime() 00023 {;} 00024 00025 TBenchmark::~TBenchmark() 00026 {;} 00027 00028 Tvoid TBenchmark::Start() 00029 { 00030 theSystemTimer.Start(); 00031 theStartTime = theSystemClock.WhatTimeIsItNow(); 00032 return; 00033 } 00034 00035 Tvoid TBenchmark::Pause() 00036 { 00037 theSystemTimer.Pause(); 00038 theSystemTimer.Lap(); 00039 return; 00040 } 00041 00042 Tvoid TBenchmark::Restart() 00043 { 00044 theSystemTimer.Restart(); 00045 return; 00046 } 00047 00048 Tvoid TBenchmark::Stop() 00049 { 00050 theSystemTimer.Stop(); 00051 theStopTime = theSystemClock.WhatTimeIsItNow(); 00052 return; 00053 } 00054 00055 Tvoid TBenchmark::Lap() 00056 { 00057 theSystemTimer.Lap(); 00058 return; 00059 } 00060 00061 Tvoid TBenchmark::Continue() 00062 { 00063 theSystemTimer.Lap(); 00064 return; 00065 } 00066 00067 Tvoid TBenchmark::PrintResult() 00068 { 00069 Tcout << *this << Tendl; 00070 return; 00071 } 00072 00073 Tostream& operator<<( Tostream& tos, const TBenchmark& right ) 00074 { 00075 tos << "Start: " << right.theStartTime << Tendl; 00076 tos << "Stop: " << right.theStopTime << Tendl; 00077 tos << right.theSystemTimer << Tflush; 00078 return tos; 00079 } 00080 00081 #ifdef __CLDAQ_ROOT_DLL 00082 ClassImp(TBenchmark) 00083 #endif