Teuchos::Time Class Reference

Basic wall-clock timer class. More...

#include <Teuchos_Time.hpp>

List of all members.

Public Member Functions

 Time (const string &name, bool start=false)
 Construct with a descriptive name.
void start (bool reset=false)
 Starts the timer.
double stop ()
 Stops the timer.
double totalElapsedTime () const
 Returns the total time accumulated by this timer. This should be called only when the clock is stopped..
bool isRunning () const
 Indicates if this timer is currently running, i.e., if it has been started but not yet stopped.
const string & name () const
 Return the name of this timer.

Static Public Member Functions

double wallTime ()
 Returns current wall-clock time in seconds.

Private Attributes

double startTime_
double totalTime_
bool isRunning_
string name_


Detailed Description

Basic wall-clock timer class.

To time a section of code, place it in between calls to start() and stop().

Note:
For exception safety and correct behavior in reentrant code, this class should generally be used only through the Teuchos::TimeMonitor mechanism.

Definition at line 77 of file Teuchos_Time.hpp.


Constructor & Destructor Documentation

Time::Time const string &  name,
bool  start = false
 

Construct with a descriptive name.

Definition at line 37 of file Teuchos_Time.cpp.


Member Function Documentation

double Time::wallTime  )  [static]
 

Returns current wall-clock time in seconds.

Definition at line 61 of file Teuchos_Time.cpp.

void Time::start bool  reset = false  ) 
 

Starts the timer.

Definition at line 43 of file Teuchos_Time.cpp.

double Time::stop  ) 
 

Stops the timer.

Definition at line 50 of file Teuchos_Time.cpp.

double Teuchos::Time::totalElapsedTime  )  const [inline]
 

Returns the total time accumulated by this timer. This should be called only when the clock is stopped..

Definition at line 95 of file Teuchos_Time.hpp.

bool Teuchos::Time::isRunning  )  const [inline]
 

Indicates if this timer is currently running, i.e., if it has been started but not yet stopped.

It is necessary to know if a timer is running to avoid incorrectly starting or stopping in reentrant code.

Definition at line 102 of file Teuchos_Time.hpp.

const string& Teuchos::Time::name  )  const [inline]
 

Return the name of this timer.

Definition at line 105 of file Teuchos_Time.hpp.


Member Data Documentation

double Teuchos::Time::startTime_ [private]
 

Definition at line 108 of file Teuchos_Time.hpp.

double Teuchos::Time::totalTime_ [private]
 

Definition at line 110 of file Teuchos_Time.hpp.

bool Teuchos::Time::isRunning_ [private]
 

Definition at line 112 of file Teuchos_Time.hpp.

string Teuchos::Time::name_ [private]
 

Definition at line 114 of file Teuchos_Time.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:41:20 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1