|
Teuchos - Trilinos Tools Package
Version of the Day
|
Basic wall-clock timer class. More...
#include <Teuchos_Time.hpp>
Public Member Functions | |
| Time (const std::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 (bool readCurrentTime=false) const |
| Returns the total time (in seconds) accumulated by this timer. | |
| void | reset () |
| Resets the cummulative time and number of times this timer has been called. Does not affect any other state. | |
| bool | isRunning () const |
| Indicates if this timer is currently running, i.e., if it has been started but not yet stopped. | |
| const std::string & | name () const |
| Return the name of this timer. | |
| void | incrementNumCalls () |
| Increment the number of times this timer has been called. | |
| int | numCalls () const |
| Return the number of times this timer has been called. | |
Static Public Member Functions | |
| static double | wallTime () |
| Returns current wall-clock time in seconds. | |
Basic wall-clock timer class.
To time a section of code, place it in between calls to start() and stop().
Definition at line 93 of file Teuchos_Time.hpp.
| Teuchos::Time::Time | ( | const std::string & | name, |
| bool | start = false |
||
| ) |
Construct with a descriptive name.
Definition at line 78 of file Teuchos_Time.cpp.
| double Teuchos::Time::wallTime | ( | ) | [static] |
Returns current wall-clock time in seconds.
Definition at line 109 of file Teuchos_Time.cpp.
| void Teuchos::Time::start | ( | bool | reset = false | ) |
Starts the timer.
Definition at line 84 of file Teuchos_Time.cpp.
| double Teuchos::Time::stop | ( | ) |
Stops the timer.
Definition at line 91 of file Teuchos_Time.cpp.
| double Teuchos::Time::totalElapsedTime | ( | bool | readCurrentTime = false | ) | const |
Returns the total time (in seconds) accumulated by this timer.
This should be called only when the clock is stopped.
Definition at line 101 of file Teuchos_Time.cpp.
| void Teuchos::Time::reset | ( | ) | [inline] |
Resets the cummulative time and number of times this timer has been called. Does not affect any other state.
Definition at line 116 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 123 of file Teuchos_Time.hpp.
| const std::string& Teuchos::Time::name | ( | ) | const [inline] |
Return the name of this timer.
Definition at line 126 of file Teuchos_Time.hpp.
| void Teuchos::Time::incrementNumCalls | ( | ) | [inline] |
Increment the number of times this timer has been called.
Definition at line 129 of file Teuchos_Time.hpp.
| int Teuchos::Time::numCalls | ( | ) | const [inline] |
Return the number of times this timer has been called.
Definition at line 132 of file Teuchos_Time.hpp.
1.7.6.1