Timer Class Reference

#include <Timer.h>

Collaboration diagram for Timer:
Collaboration graph
[legend]

List of all members.

Public Types

enum  State { Running, Paused }
enum  { MaxNameLength = 32 }

Public Member Functions

 Timer (String const &name, State initialState=Paused)
 ~Timer ()
void reset (String const &name, State newState)
String const & name () const
double elapsed (bool timeCalled=false)
double cpu (bool called=false)
double user_cpu (bool called=false)
double system_cpu (bool called=false)
long max_memory (bool called=false)
long shared_memory (bool called=false)
long unshared_data_memory (bool called=false)
long unshared_stack_memory (bool called=false)
long minor_page_faults (bool called=false)
long major_page_faults (bool called=false)
long page_faults (bool called=false)
long blocked_input_ops (bool called=false)
long blocked_output_ops (bool called=false)
void pause ()
void cont ()
void getTimes (double &elapsed, double &user_cpu, double &system_cpu, double &cpu, long &max_memory, long &shared_memory, long &unshared_data_memory, long &unshared_stack_memory, long &page_faults, long &minor_page_faults, long &major_page_faults, long &blocked_input_ops, long &blocked_output_ops)

Private Member Functions

 Timer (Timer const &)
Timeroperator= (Timer const &)
void updateResourceUsage ()
void updateTime ()
double currentElapsed ()
double currentCpu ()
double currentUserCpu ()
double currentSystemCpu ()
long currentMaxMemory ()
long currentSharedMemory ()
long currentUnsharedDataMemory ()
long currentUnsharedStackMemory ()
long currentPageFaults ()
long currentMinorPageFaults ()
long currentMajorPageFaults ()
long currentBlockedInputOps ()
long currentBlockedOutputOps ()
void start ()

Private Attributes

State state
time_t time_now
struct rusage resource_usage
String label
double time_start
double cpu_start
double user_cpu_start
double system_cpu_start
long max_memory_start
long shared_memory_start
long unshared_data_memory_start
long unshared_stack_memory_start
long page_faults_start
long major_page_faults_start
long minor_page_faults_start
long blocked_input_ops_start
long blocked_output_ops_start
double time_accum
double cpu_accum
double user_cpu_accum
double system_cpu_accum
long max_memory_accum
long shared_memory_accum
long unshared_data_memory_accum
long unshared_stack_memory_accum
long page_faults_accum
long minor_page_faults_accum
long major_page_faults_accum
long blocked_input_ops_accum
long blocked_output_ops_accum

Detailed Description

Definition at line 23 of file Timer.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
MaxNameLength 

Definition at line 48 of file Timer.h.

Enumerator:
Running 
Paused 

Definition at line 47 of file Timer.h.


Constructor & Destructor Documentation

Timer::Timer ( String const &  name,
State  initialState = Paused 
)

Definition at line 28 of file Timer.cpp.

References reset().

Timer::~Timer (  ) 

Definition at line 63 of file Timer.cpp.

Timer::Timer ( Timer const &   )  [private]

Member Function Documentation

long int Timer::blocked_input_ops ( bool  called = false  ) 
long int Timer::blocked_output_ops ( bool  called = false  ) 
void Timer::cont (  ) 

Definition at line 277 of file Timer.cpp.

References Paused, Running, start(), and state.

double Timer::cpu ( bool  called = false  ) 

Definition at line 98 of file Timer.cpp.

References cpu_accum, cpu_start, currentCpu(), Running, state, and updateResourceUsage().

Referenced by getTimes().

long Timer::currentBlockedInputOps (  )  [inline, private]

Definition at line 199 of file Timer.h.

References resource_usage.

Referenced by blocked_input_ops(), pause(), and start().

long Timer::currentBlockedOutputOps (  )  [inline, private]

Definition at line 204 of file Timer.h.

References resource_usage.

Referenced by blocked_output_ops(), pause(), and start().

double Timer::currentCpu (  )  [inline, private]

Definition at line 147 of file Timer.h.

References currentSystemCpu(), and currentUserCpu().

Referenced by cpu(), pause(), and start().

double Timer::currentElapsed (  )  [inline, private]

Definition at line 142 of file Timer.h.

References time_now.

Referenced by elapsed(), pause(), and start().

long Timer::currentMajorPageFaults (  )  [inline, private]

Definition at line 194 of file Timer.h.

References resource_usage.

Referenced by currentPageFaults(), major_page_faults(), pause(), and start().

long Timer::currentMaxMemory (  )  [inline, private]

Definition at line 164 of file Timer.h.

References resource_usage.

Referenced by max_memory(), pause(), and start().

long Timer::currentMinorPageFaults (  )  [inline, private]

Definition at line 189 of file Timer.h.

References resource_usage.

Referenced by currentPageFaults(), minor_page_faults(), pause(), and start().

long Timer::currentPageFaults (  )  [inline, private]

Definition at line 184 of file Timer.h.

References currentMajorPageFaults(), and currentMinorPageFaults().

Referenced by page_faults(), pause(), and start().

long Timer::currentSharedMemory (  )  [inline, private]

Definition at line 169 of file Timer.h.

References resource_usage.

Referenced by pause(), shared_memory(), and start().

double Timer::currentSystemCpu (  )  [inline, private]

Definition at line 158 of file Timer.h.

References resource_usage.

Referenced by currentCpu(), pause(), start(), and system_cpu().

long Timer::currentUnsharedDataMemory (  )  [inline, private]

Definition at line 174 of file Timer.h.

References resource_usage.

Referenced by pause(), start(), and unshared_data_memory().

long Timer::currentUnsharedStackMemory (  )  [inline, private]

Definition at line 179 of file Timer.h.

References resource_usage.

Referenced by pause(), start(), and unshared_stack_memory().

double Timer::currentUserCpu (  )  [inline, private]

Definition at line 152 of file Timer.h.

References resource_usage.

Referenced by currentCpu(), pause(), start(), and user_cpu().

double Timer::elapsed ( bool  timeCalled = false  ) 

Definition at line 85 of file Timer.cpp.

References currentElapsed(), Running, state, time_accum, time_start, and updateTime().

Referenced by getTimes().

void Timer::getTimes ( double &  elapsed,
double &  user_cpu,
double &  system_cpu,
double &  cpu,
long &  max_memory,
long &  shared_memory,
long &  unshared_data_memory,
long &  unshared_stack_memory,
long &  page_faults,
long &  minor_page_faults,
long &  major_page_faults,
long &  blocked_input_ops,
long &  blocked_output_ops 
)
long int Timer::major_page_faults ( bool  called = false  ) 
long int Timer::max_memory ( bool  called = false  ) 

Definition at line 137 of file Timer.cpp.

References currentMaxMemory(), max_memory_accum, max_memory_start, Running, state, and updateResourceUsage().

Referenced by getTimes().

long int Timer::minor_page_faults ( bool  called = false  ) 
String const & Timer::name (  )  const

Definition at line 67 of file Timer.cpp.

References label.

Referenced by operator<<().

Timer& Timer::operator= ( Timer const &   )  [private]
long int Timer::page_faults ( bool  called = false  ) 

Definition at line 189 of file Timer.cpp.

References currentPageFaults(), page_faults_accum, page_faults_start, Running, state, and updateResourceUsage().

Referenced by getTimes().

void Timer::pause (  ) 
void Timer::reset ( String const &  name,
State  newState 
)
long int Timer::shared_memory ( bool  called = false  ) 
void Timer::start (  )  [inline, private]
double Timer::system_cpu ( bool  called = false  ) 

Definition at line 124 of file Timer.cpp.

References currentSystemCpu(), Running, state, system_cpu_accum, system_cpu_start, and updateResourceUsage().

Referenced by getTimes().

long int Timer::unshared_data_memory ( bool  called = false  ) 
long int Timer::unshared_stack_memory ( bool  called = false  ) 
void Timer::updateResourceUsage (  )  [inline, private]
void Timer::updateTime (  )  [inline, private]

Definition at line 137 of file Timer.h.

References time_now.

Referenced by elapsed(), getTimes(), pause(), and start().

double Timer::user_cpu ( bool  called = false  ) 

Definition at line 111 of file Timer.cpp.

References currentUserCpu(), Running, state, updateResourceUsage(), user_cpu_accum, and user_cpu_start.

Referenced by getTimes().


Member Data Documentation

Definition at line 123 of file Timer.h.

Referenced by blocked_input_ops(), pause(), and reset().

Definition at line 109 of file Timer.h.

Referenced by blocked_input_ops(), pause(), and start().

Definition at line 124 of file Timer.h.

Referenced by blocked_output_ops(), pause(), and reset().

Definition at line 110 of file Timer.h.

Referenced by blocked_output_ops(), pause(), and start().

double Timer::cpu_accum [private]

Definition at line 113 of file Timer.h.

Referenced by cpu(), pause(), and reset().

double Timer::cpu_start [private]

Definition at line 99 of file Timer.h.

Referenced by cpu(), pause(), and start().

String Timer::label [private]

Definition at line 97 of file Timer.h.

Referenced by name(), and reset().

Definition at line 122 of file Timer.h.

Referenced by major_page_faults(), pause(), and reset().

Definition at line 107 of file Timer.h.

Referenced by major_page_faults(), pause(), and start().

long Timer::max_memory_accum [private]

Definition at line 116 of file Timer.h.

Referenced by max_memory(), pause(), and reset().

long Timer::max_memory_start [private]

Definition at line 102 of file Timer.h.

Referenced by max_memory(), pause(), and start().

Definition at line 121 of file Timer.h.

Referenced by minor_page_faults(), pause(), and reset().

Definition at line 108 of file Timer.h.

Referenced by minor_page_faults(), pause(), and start().

long Timer::page_faults_accum [private]

Definition at line 120 of file Timer.h.

Referenced by page_faults(), pause(), and reset().

long Timer::page_faults_start [private]

Definition at line 106 of file Timer.h.

Referenced by page_faults(), pause(), and start().

struct rusage Timer::resource_usage [private]

Definition at line 117 of file Timer.h.

Referenced by pause(), reset(), and shared_memory().

Definition at line 103 of file Timer.h.

Referenced by pause(), shared_memory(), and start().

State Timer::state [private]
double Timer::system_cpu_accum [private]

Definition at line 115 of file Timer.h.

Referenced by pause(), reset(), and system_cpu().

double Timer::system_cpu_start [private]

Definition at line 101 of file Timer.h.

Referenced by pause(), start(), and system_cpu().

double Timer::time_accum [private]

Definition at line 112 of file Timer.h.

Referenced by elapsed(), pause(), and reset().

time_t Timer::time_now [private]

Definition at line 94 of file Timer.h.

Referenced by currentElapsed(), and updateTime().

double Timer::time_start [private]

Definition at line 98 of file Timer.h.

Referenced by elapsed(), pause(), and start().

Definition at line 118 of file Timer.h.

Referenced by pause(), reset(), and unshared_data_memory().

Definition at line 104 of file Timer.h.

Referenced by pause(), start(), and unshared_data_memory().

Definition at line 119 of file Timer.h.

Referenced by pause(), reset(), and unshared_stack_memory().

Definition at line 105 of file Timer.h.

Referenced by pause(), start(), and unshared_stack_memory().

double Timer::user_cpu_accum [private]

Definition at line 114 of file Timer.h.

Referenced by pause(), reset(), and user_cpu().

double Timer::user_cpu_start [private]

Definition at line 100 of file Timer.h.

Referenced by pause(), start(), and user_cpu().


The documentation for this class was generated from the following files:
Generated on Mon Oct 4 10:40:37 2010 for Matching.kdevelop by  doxygen 1.6.3