Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4Timer Class Reference

#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
 

Detailed Description

Definition at line 110 of file G4Timer.hh.

Constructor & Destructor Documentation

G4Timer::G4Timer ( )

Definition at line 102 of file G4Timer.cc.

103  : fValidTimes(false)
104 {
105 }

Member Function Documentation

const char* G4Timer::GetClockTime ( ) const
inline
G4double G4Timer::GetRealElapsed ( ) const

Definition at line 107 of file G4Timer.cc.

References FatalException, and G4Exception().

Referenced by RMC01AnalysisManager::EndOfEvent(), ExGflashEventAction::EndOfEventAction(), export_G4Timer(), main(), and operator<<().

108 {
109  if (!fValidTimes)
110  {
111  G4Exception("G4Timer::GetRealElapsed()", "InvalidCondition",
112  FatalException, "Timer not stopped or times not recorded!");
113  }
114  G4double diff=fEndRealTime-fStartRealTime;
115  return diff/sysconf(_SC_CLK_TCK);
116 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double G4double
Definition: G4Types.hh:76
G4double G4Timer::GetSystemElapsed ( ) const

Definition at line 119 of file G4Timer.cc.

References FatalException, and G4Exception().

Referenced by G4ConvergenceTester::AddScore(), ExGflashEventAction::EndOfEventAction(), export_G4Timer(), main(), operator<<(), and G4RunManager::ReOptimize().

120 {
121  if (!fValidTimes)
122  {
123  G4Exception("G4Timer::GetSystemElapsed()", "InvalidCondition",
124  FatalException, "Timer not stopped or times not recorded!");
125  }
126  G4double diff=fEndTimes.tms_stime-fStartTimes.tms_stime;
127  return diff/sysconf(_SC_CLK_TCK);
128 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double G4double
Definition: G4Types.hh:76
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(), ExGflashEventAction::EndOfEventAction(), CML2RunAction::EndOfRunAction(), export_G4Timer(), main(), operator<<(), G4RunManager::ReOptimize(), F03PhysicsList::SetCuts(), F02PhysicsList::SetCuts(), and F01PhysicsList::SetCuts().

131 {
132  if (!fValidTimes)
133  {
134  G4Exception("G4Timer::GetUserElapsed()", "InvalidCondition",
135  FatalException, "Timer not stopped or times not recorded");
136  }
137  G4double diff=fEndTimes.tms_utime-fStartTimes.tms_utime;
138  return diff/sysconf(_SC_CLK_TCK);
139 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double G4double
Definition: G4Types.hh:76
G4bool G4Timer::IsValid ( ) const
inline

Referenced by export_G4Timer(), and operator<<().

void G4Timer::Start ( )
inline
void G4Timer::Stop ( )
inline

The documentation for this class was generated from the following files: