Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeElapsedTime Class Reference

an easy to use class for measuring elapsed time More...

#include <cascade/util/CascadeElapsedTime.h>

Inheritance diagram for CascadeElapsedTime:

CascadeObject List of all members.

Public Member Functions

 CascadeElapsedTime ()
virtual ~CascadeElapsedTime ()
void Start ()
void Stop ()
void Report (const char *pString=NULL)

Protected Attributes

u64 m_nMillisecondsStart
u64 m_nMillisecondsStop

Detailed Description

an easy to use class for measuring elapsed time

Skip the description

CascadeElapsedTime is a useful class for measuring the elapsed time (in seconds and milliseconds) of a section of code.

Example:

    CascadeElapsedTime et;
    et.Start();
    /* do some lengthy operation */
    et.Stop();
    et.Report("My lengthy operation took: ");
    

Output:

    My lengthy operation took: 0.467 seconds.


class CascadeElapsedTime


Constructor & Destructor Documentation

CascadeElapsedTime::CascadeElapsedTime  ) 
 

constructs a CascadeElapsedTime object

The CascadeElapsedTime constructor is lightweight.

virtual CascadeElapsedTime::~CascadeElapsedTime  )  [virtual]
 

destructor

This is the CascadeElapsedTime destructor.


Member Function Documentation

void CascadeElapsedTime::Report const char *  pString = NULL  ) 
 

reports the elapsed time in seconds and milliseconds

Report() reports the time elapsed between calls to Start() and Stop(). Report() must only be called after the elapsed time counter has been started and stopped.

Parameters:
pString a string to preface the report with
See also:
Start(), Stop()

void CascadeElapsedTime::Start  ) 
 

starts the elapsed time counter

Start() starts the elapsed time counter. After starting the elapsed time counter, call Stop() and then Report()

See also:
Stop(), Report()

void CascadeElapsedTime::Stop  ) 
 

stops the elapsed time counter

Stop() stops the elapsed time counter. After stopping the elapsed time counter, call Report() to report the results.

See also:
Start(), Report()


Member Data Documentation

u64 CascadeElapsedTime::m_nMillisecondsStart [protected]
 

u64 CascadeElapsedTime::m_nMillisecondsStop [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:19 2005 for Cascade Library by  doxygen 1.4.1