Public Member Functions | Private Attributes | List of all members
cet::cpu_timer Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/cetlib/v3_06_01/source/cetlib/cpu_timer.h"

Public Member Functions

 cpu_timer ()=default
 
 cpu_timer (cpu_timer &&)=default
 
cpu_timeroperator= (cpu_timer &&)=default
 
 cpu_timer (cpu_timer const &)=delete
 
cpu_timeroperator= (cpu_timer const &)=delete
 
bool is_running () const
 
bool is_stopped () const
 
double elapsed_real_time () const
 
double elapsed_cpu_time () const
 
double accumulated_real_time () const
 
double accumulated_cpu_time () const
 
double realTime () const
 
double cpuTime () const
 
void start ()
 
void stop ()
 
void reset ()
 

Private Attributes

bool is_running_ {false}
 
timeval start_real_time_ {0, 0}
 
timeval start_cpu_time_ {0, 0}
 
double accumulated_real_time_ {}
 
double accumulated_cpu_time_ {}
 

Detailed Description

Definition at line 18 of file cpu_timer.h.

Constructor & Destructor Documentation

cet::cpu_timer::cpu_timer ( )
default
cet::cpu_timer::cpu_timer ( cpu_timer &&  )
default
cet::cpu_timer::cpu_timer ( cpu_timer const &  )
delete

Member Function Documentation

double cet::cpu_timer::accumulated_cpu_time ( ) const

Referenced by cpuTime().

double cet::cpu_timer::accumulated_real_time ( ) const

Referenced by realTime().

double cet::cpu_timer::cpuTime ( ) const
inline

Definition at line 44 of file cpu_timer.h.

References accumulated_cpu_time(), reset(), start(), and stop().

45  {
46  return accumulated_cpu_time();
47  }
double accumulated_cpu_time() const
double cet::cpu_timer::elapsed_cpu_time ( ) const
double cet::cpu_timer::elapsed_real_time ( ) const
bool cet::cpu_timer::is_running ( ) const
inline

Definition at line 67 of file cpu_timer.h.

References is_running_.

Referenced by is_stopped().

68 {
69  return is_running_;
70 }
bool is_running_
Definition: cpu_timer.h:56
bool cet::cpu_timer::is_stopped ( ) const
inline

Definition at line 73 of file cpu_timer.h.

References is_running().

74 {
75  return !is_running();
76 }
bool is_running() const
Definition: cpu_timer.h:67
cpu_timer& cet::cpu_timer::operator= ( cpu_timer &&  )
default
cpu_timer& cet::cpu_timer::operator= ( cpu_timer const &  )
delete
double cet::cpu_timer::realTime ( ) const
inline

Definition at line 39 of file cpu_timer.h.

References accumulated_real_time().

40  {
41  return accumulated_real_time();
42  }
double accumulated_real_time() const
void cet::cpu_timer::reset ( )

Referenced by cpuTime().

void cet::cpu_timer::start ( )

Referenced by cpuTime().

void cet::cpu_timer::stop ( )

Referenced by cpuTime().

Member Data Documentation

double cet::cpu_timer::accumulated_cpu_time_ {}
private

Definition at line 60 of file cpu_timer.h.

double cet::cpu_timer::accumulated_real_time_ {}
private

Definition at line 59 of file cpu_timer.h.

bool cet::cpu_timer::is_running_ {false}
private

Definition at line 56 of file cpu_timer.h.

Referenced by is_running().

timeval cet::cpu_timer::start_cpu_time_ {0, 0}
private

Definition at line 58 of file cpu_timer.h.

timeval cet::cpu_timer::start_real_time_ {0, 0}
private

Definition at line 57 of file cpu_timer.h.


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