#include <G4Timer.hh>
Public Member Functions | |
G4Timer () | |
void | Start () |
void | Stop () |
G4bool | IsValid () const |
const char * | GetClockTime () const |
G4double | GetRealElapsed () const |
G4double | GetSystemElapsed () const |
G4double | GetUserElapsed () const |
Definition at line 110 of file G4Timer.hh.
G4Timer::G4Timer | ( | ) |
const char * G4Timer::GetClockTime | ( | ) | const [inline] |
Definition at line 54 of file G4Timer.icc.
00055 { 00056 time_t rawtime; 00057 struct tm * timeinfo; 00058 00059 time ( &rawtime ); 00060 timeinfo = localtime ( &rawtime ); 00061 return asctime (timeinfo); 00062 }
G4double G4Timer::GetRealElapsed | ( | ) | const |
Definition at line 107 of file G4Timer.cc.
References FatalException, and G4Exception().
Referenced by operator<<().
00108 { 00109 if (!fValidTimes) 00110 { 00111 G4Exception("G4Timer::GetRealElapsed()", "InvalidCondition", 00112 FatalException, "Timer not stopped or times not recorded!"); 00113 } 00114 G4double diff=fEndRealTime-fStartRealTime; 00115 return diff/sysconf(_SC_CLK_TCK); 00116 }
G4double G4Timer::GetSystemElapsed | ( | ) | const |
Definition at line 119 of file G4Timer.cc.
References FatalException, and G4Exception().
Referenced by G4ConvergenceTester::AddScore(), and operator<<().
00120 { 00121 if (!fValidTimes) 00122 { 00123 G4Exception("G4Timer::GetSystemElapsed()", "InvalidCondition", 00124 FatalException, "Timer not stopped or times not recorded!"); 00125 } 00126 G4double diff=fEndTimes.tms_stime-fStartTimes.tms_stime; 00127 return diff/sysconf(_SC_CLK_TCK); 00128 }
G4double G4Timer::GetUserElapsed | ( | ) | const |
Definition at line 130 of file G4Timer.cc.
References FatalException, and G4Exception().
Referenced by G4ConvergenceTester::AddScore(), G4VXTRenergyLoss::BuildAngleForEnergyBank(), G4VXTRenergyLoss::BuildAngleTable(), G4VXTRenergyLoss::BuildEnergyTable(), G4VXTRenergyLoss::BuildGlobalAngleTable(), and operator<<().
00131 { 00132 if (!fValidTimes) 00133 { 00134 G4Exception("G4Timer::GetUserElapsed()", "InvalidCondition", 00135 FatalException, "Timer not stopped or times not recorded"); 00136 } 00137 G4double diff=fEndTimes.tms_utime-fStartTimes.tms_utime; 00138 return diff/sysconf(_SC_CLK_TCK); 00139 }
G4bool G4Timer::IsValid | ( | ) | const [inline] |
void G4Timer::Start | ( | ) | [inline] |
Definition at line 35 of file G4Timer.icc.
References times.
Referenced by G4VXTRenergyLoss::BuildAngleForEnergyBank(), G4VXTRenergyLoss::BuildAngleTable(), G4VXTRenergyLoss::BuildEnergyTable(), G4VXTRenergyLoss::BuildGlobalAngleTable(), G4ConvergenceTester::G4ConvergenceTester(), G4RunManager::InitializeEventLoop(), and G4ProductionCutsTable::UpdateCoupleTable().
00036 { 00037 fValidTimes=false; 00038 fStartRealTime=times(&fStartTimes); 00039 }
void G4Timer::Stop | ( | ) | [inline] |
Definition at line 42 of file G4Timer.icc.
References times.
Referenced by G4ConvergenceTester::AddScore(), G4VXTRenergyLoss::BuildAngleForEnergyBank(), G4VXTRenergyLoss::BuildAngleTable(), G4VXTRenergyLoss::BuildEnergyTable(), G4VXTRenergyLoss::BuildGlobalAngleTable(), G4RunManager::TerminateEventLoop(), and G4ProductionCutsTable::UpdateCoupleTable().
00043 { 00044 fEndRealTime=times(&fEndTimes); 00045 fValidTimes=true; 00046 }