The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
System::ProcessTime Class Reference

Simple class to hold the time information of a process. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/Timing.h>

Public Types

typedef long long TimeValueType
 

Public Member Functions

 ProcessTime ()
 Constructor.
 
 ProcessTime (TimeValueType k, TimeValueType u, TimeValueType e)
 Constructor.
 
template<TimeType T>
TimeValueType kernelTime () const
 Retrieve the kernel time in the requested unit.
 
template<TimeType T>
TimeValueType userTime () const
 Retrieve the user time in the requested unit.
 
template<TimeType T>
TimeValueType elapsedTime () const
 Retrieve the elapsed time in the requested unit.
 
template<TimeType T>
TimeValueType cpuTime () const
 Retrieve the CPU (user+kernel) time in the requested unit.
 
ProcessTime operator- (const ProcessTime &rhs) const
 Return the delta between two ProcessTime objects.
 
ProcessTimeoperator+= (const ProcessTime &rhs)
 Add the timings to the current objects.
 

Private Attributes

TimeValueType i_kernel
 Internal storage.
 
TimeValueType i_user
 
TimeValueType i_elapsed
 

Detailed Description

Simple class to hold the time information of a process.

Simplify the simultaneous handling of kernel, user and elapsed times of a process.

See also
{bug #87341}

Definition at line 134 of file Timing.h.

Member Typedef Documentation

◆ TimeValueType

Definition at line 136 of file Timing.h.

Constructor & Destructor Documentation

◆ ProcessTime() [1/2]

System::ProcessTime::ProcessTime ( )
inline

Constructor.

Definition at line 139 of file Timing.h.

139: i_kernel( 0 ), i_user( 0 ), i_elapsed( 0 ) {}
TimeValueType i_elapsed
Definition Timing.h:182
TimeValueType i_kernel
Internal storage.
Definition Timing.h:182
TimeValueType i_user
Definition Timing.h:182

◆ ProcessTime() [2/2]

System::ProcessTime::ProcessTime ( TimeValueType k,
TimeValueType u,
TimeValueType e )
inline

Constructor.

Definition at line 142 of file Timing.h.

142: i_kernel( k ), i_user( u ), i_elapsed( e ) {}

Member Function Documentation

◆ cpuTime()

template<TimeType T>
TimeValueType System::ProcessTime::cpuTime ( ) const
inline

Retrieve the CPU (user+kernel) time in the requested unit.

Definition at line 164 of file Timing.h.

164 {
165 return adjustTime<T>( i_user + i_kernel );
166 }
GAUDI_API long long adjustTime(TimeType typ, long long timevalue)
Convert time from OS native time to requested representation (Experts only)
Definition Timing.cpp:38

◆ elapsedTime()

template<TimeType T>
TimeValueType System::ProcessTime::elapsedTime ( ) const
inline

Retrieve the elapsed time in the requested unit.

Definition at line 158 of file Timing.h.

158 {
159 return adjustTime<T>( i_elapsed );
160 }

◆ kernelTime()

template<TimeType T>
TimeValueType System::ProcessTime::kernelTime ( ) const
inline

Retrieve the kernel time in the requested unit.

Definition at line 146 of file Timing.h.

146 {
147 return adjustTime<T>( i_kernel );
148 }

◆ operator+=()

ProcessTime & System::ProcessTime::operator+= ( const ProcessTime & rhs)
inline

Add the timings to the current objects.

Definition at line 173 of file Timing.h.

173 {
174 i_kernel += rhs.i_kernel;
175 i_user += rhs.i_user;
176 i_elapsed += rhs.i_elapsed;
177 return *this;
178 }

◆ operator-()

ProcessTime System::ProcessTime::operator- ( const ProcessTime & rhs) const
inline

Return the delta between two ProcessTime objects.

Definition at line 169 of file Timing.h.

169 {
170 return ProcessTime( i_kernel - rhs.i_kernel, i_user - rhs.i_user, i_elapsed - rhs.i_elapsed );
171 }
ProcessTime()
Constructor.
Definition Timing.h:139

◆ userTime()

template<TimeType T>
TimeValueType System::ProcessTime::userTime ( ) const
inline

Retrieve the user time in the requested unit.

Definition at line 152 of file Timing.h.

152 {
153 return adjustTime<T>( i_user );
154 }

Member Data Documentation

◆ i_elapsed

TimeValueType System::ProcessTime::i_elapsed
private

Definition at line 182 of file Timing.h.

◆ i_kernel

TimeValueType System::ProcessTime::i_kernel
private

Internal storage.

Definition at line 182 of file Timing.h.

◆ i_user

TimeValueType System::ProcessTime::i_user
private

Definition at line 182 of file Timing.h.


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