Conjecture::CpuTimer Class Reference

#include <CpuTimer.h>

Inheritance diagram for Conjecture::CpuTimer:

Conjecture::Root List of all members.

Detailed Description

microsecond-level timing support

*****************************************************************

Provides a microsecond level CPU usage timer, for user time, system time, or a combination of both. See also the WallTimer class.

Standard usage is: using namespace Conjecture; CpuTimer timer; // turned on when created. ... cout << "Total microsecond used: " << timer.millitime() << endl;

Features are: timer.stop(); // stop timing so subsequent timing requests all // apply to the same time interval timer.start(); // restart the timer from now. timer.print(); // prints out a full summary timer.XtimeY(); // Returns time interval in request units X (seconds // if X is empty, otherwise X = 'milli' or 'micro'). // Only returns the time for request cpu section Y // (both if Y is empty, otherwise Y = 'System' or 'User').


Public Member Functions

const bool & running () const
const struct rusage & reading () const
const struct rusage & start () const
void start ()
void stop ()
unsigned time () const
unsigned timeUser () const
unsigned timeSystem () const
unsigned millitime () const
unsigned millitimeUser () const
unsigned millitimeSystem () const
unsigned microtime () const
unsigned microtimeUser () const
unsigned microtimeSystem () const
void print (ostream &os=cout) const
void printSummary (ostream &os=cout) const
void printMilliSummary (ostream &os=cout) const
void printMicroSummary (ostream &os=cout) const

Static Public Member Functions

static void test (int argc=0, const char *argv[]=NULL)

Protected Member Functions

void runningIs (const bool &running)
void readingIs (const struct rusage &reading)
void startIs (const struct rusage &start)


Member Function Documentation

unsigned Conjecture::CpuTimer::microtime  )  const [inline]
 

Returns the number of microseconds between start and stop time.

unsigned Conjecture::CpuTimer::microtimeSystem  )  const [inline]
 

Returns the number of system microseconds between start and stop time.

unsigned Conjecture::CpuTimer::microtimeUser  )  const [inline]
 

Returns the number of user microseconds between start and stop time.

unsigned Conjecture::CpuTimer::millitime  )  const [inline]
 

Returns the number of milliseconds between start and stop time.

unsigned Conjecture::CpuTimer::millitimeSystem  )  const [inline]
 

Returns the number of system milliseconds between start and stop time.

unsigned Conjecture::CpuTimer::millitimeUser  )  const [inline]
 

Returns the number of user milliseconds between start and stop time.

void Conjecture::CpuTimer::print ostream &  os = cout  )  const
 

Print a description of the time results

void Conjecture::CpuTimer::printSummary ostream &  os = cout  )  const
 

Print a one-line description of the time results

void Conjecture::CpuTimer::start  ) 
 

Start the timer (remember current time)

void Conjecture::CpuTimer::stop  ) 
 

Stop the timer (remember current time)

unsigned Conjecture::CpuTimer::time  )  const [inline]
 

Returns the number of seconds between start and stop time.

unsigned Conjecture::CpuTimer::timeSystem  )  const [inline]
 

Returns the number of system seconds between start and stop time.

unsigned Conjecture::CpuTimer::timeUser  )  const [inline]
 

Returns the number of user seconds between start and stop time.


The documentation for this class was generated from the following files:
Generated on Thu Jun 15 19:56:12 2006 for Conjecture by  doxygen 1.4.6