Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::Timer Class Reference
[Base]

Measures code execution time. More...

#include <Timer.h>

Inheritance diagram for OSCAR::Timer:

Inheritance graph
[legend]
List of all members.

Public Methods

 Timer ()
virtual ~Timer ()
void Start ()
void Stop ()
double ElapsedTime () const

Private Attributes

clock_t start
clock_t stop
bool status

Detailed Description

Author:
Chetan Kapoor
Can be used as a stop watch to measure the execution time of pieces of code. A Timer is just like a stop watch. You can start it, stop it and then get the elapsed time between the start and the stop. Calls to different Timer objects should NOT be nested. Timer derives from Base under public virtual inheritance.


Constructor & Destructor Documentation

OSCAR::Timer::Timer   [inline]
 

Constructor.

This is the constructor for an object of type Timer. Use this to construct an Timer object. This constructor also calls the constructor of Base.

virtual OSCAR::Timer::~Timer   [inline, virtual]
 

Virtual Destructor.

This is the Destructor for an object of type Timer.


Member Function Documentation

double OSCAR::Timer::ElapsedTime   const
 

Get the elapsed time between consecutive calls to Start() and Stop().

This method is used to get the elapsed time between consecutive calls to Start() and Stop().

Returns:
Elapsed time in seconds

void OSCAR::Timer::Start  
 

Start the Timer.

This method is used to start the timer.

void OSCAR::Timer::Stop  
 

Stop the Timer.

This method is used to stop the timer.


Member Data Documentation

clock_t OSCAR::Timer::start [private]
 

bool OSCAR::Timer::status [private]
 

clock_t OSCAR::Timer::stop [private]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations