zypp::debug::Measure Class Reference

Tool to measure elapsed real and process times. More...

#include <Measure.h>

List of all members.

Public Member Functions

 Measure ()
 Default Ctor does nothing.
 Measure (const std::string &ident_r)
 Ctor taking ident_r string and auto starts timer.
 ~Measure ()
 Dtor.
void start (const std::string &ident_r=std::string())
 Start timer for ident_r string.
void restart ()
 re start the timer without reset-ing it.
void elapsed () const
 Print elapsed time for a running timer.
void stop ()
 Stop a running timer.

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation.

Classes

class  Impl
 Measure implementation. More...


Detailed Description

Tool to measure elapsed real and process times.

Timer is started by either passing a string to the ctor, or callign start. The string passed is printed on all messages to help identifying the timer.

Elapsed time is printed on calling elapsed (timer keeps running) or stop.

Calling stop, stops the timer. The same, if the timer goes out of scope.

Elapsed time is printed as:

 'REAL TIME' (u 'USER TIME' s 'SYSTEM TIME' c 'TIME OF CHILDREN')
In brackets the time elapsed since a previous call to elapsed. All units are seconds.

 Measure m( "Parse" );
 ...
 m.elapsed();
 ...
 m.elapsed();
 ...
 m.elapsed();
 ...
 m.stop();

 // START MEASURE(Parse)
 // ELAPSED(Parse)  0 (u 0.13 s 0.00 c 0.00)
 // ELAPSED(Parse)  0 (u 0.15 s 0.02 c 0.00) [ 0 (u 0.02 s 0.02 c 0.00)]
 // ELAPSED(Parse)  0 (u 0.17 s 0.02 c 0.00) [ 0 (u 0.02 s 0.00 c 0.00)]
 // MEASURE(Parse)  0 (u 0.17 s 0.02 c 0.00) [ 0 (u 0.00 s 0.00 c 0.00)]

Definition at line 68 of file Measure.h.


Constructor & Destructor Documentation

zypp::debug::Measure::Measure (  ) 

Default Ctor does nothing.

Definition at line 210 of file Measure.cc.

zypp::debug::Measure::Measure ( const std::string &  ident_r  )  [explicit]

Ctor taking ident_r string and auto starts timer.

Definition at line 218 of file Measure.cc.

zypp::debug::Measure::~Measure (  ) 

Dtor.

Definition at line 227 of file Measure.cc.


Member Function Documentation

void zypp::debug::Measure::start ( const std::string &  ident_r = std::string()  ) 

Start timer for ident_r string.

Implies stoping a running timer.

Definition at line 235 of file Measure.cc.

References _pimpl, and stop().

void zypp::debug::Measure::restart (  ) 

re start the timer without reset-ing it.

Definition at line 246 of file Measure.cc.

References _pimpl.

void zypp::debug::Measure::elapsed (  )  const

Print elapsed time for a running timer.

Timer keeps on running.

Definition at line 256 of file Measure.cc.

References _pimpl.

Referenced by zypp::cache::CacheInitializer::tablesCreated().

void zypp::debug::Measure::stop (  ) 

Stop a running timer.

Definition at line 267 of file Measure.cc.

References _pimpl.

Referenced by start().


Member Data Documentation

RW_pointer<Impl> zypp::debug::Measure::_pimpl [private]

Pointer to implementation.

Definition at line 99 of file Measure.h.

Referenced by elapsed(), restart(), start(), and stop().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:19 2007 for libzypp by  doxygen 1.5.3