Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Timer::GetSystemElapsed ( ) const

Definition at line 119 of file G4Timer.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Timer::GetUserElapsed ( ) const

Definition at line 130 of file G4Timer.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4Timer::IsValid ( ) const
inline

Here is the caller graph for this function:

void G4Timer::Start ( )
inline

Here is the caller graph for this function:

void G4Timer::Stop ( )
inline

Here is the caller graph for this function:


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