Teuchos - Trilinos Tools Package  Version of the Day
Public Member Functions | List of all members
Teuchos::BaseTimer Class Reference

the basic timer used elsewhere, uses MPI_Wtime for time More...

#include <Teuchos_StackedTimer.hpp>

Inheritance diagram for Teuchos::BaseTimer:
Teuchos::StackedTimer::LevelTimer

Public Member Functions

void start ()
 Start a currently stopped timer. More...
 
void stop ()
 Stop a current running timer and accumulate time difference. More...
 
unsigned long incrementCount (unsigned long count=1)
 Increment the total number of items updated between a start stop. More...
 
double accumulatedTime () const
 Get the total accumulated time since last reset or construction when the timer is running. More...
 
void setAccumulatedTime (double accum=0)
 Setter for accumulated time. More...
 
double accumulatedTimePerUpdate () const
 return the average time per item updated More...
 
double accumulatedTimePerTimerCall () const
 return the average time per timer start/stop More...
 
double difference (const BaseTimer &from) const
 Return the difference between two timers in seconds,. More...
 
void reset ()
 Reset all the timer stats, throws if it is already running. More...
 

Detailed Description

the basic timer used elsewhere, uses MPI_Wtime for time

This class hold a time and number of times this timer is called, and a count of how many "updates" this timer has services. Example if you have a mesh of 100 elements your count might be 7, but total iterations would be 700 this number is useful for dynamic systems where the total number of items services might change in time

Definition at line 44 of file Teuchos_StackedTimer.hpp.

Member Function Documentation

◆ start()

void Teuchos::BaseTimer::start ( )
inline

Start a currently stopped timer.

Definition at line 53 of file Teuchos_StackedTimer.hpp.

◆ stop()

void Teuchos::BaseTimer::stop ( )
inline

Stop a current running timer and accumulate time difference.

Definition at line 63 of file Teuchos_StackedTimer.hpp.

◆ incrementCount()

unsigned long Teuchos::BaseTimer::incrementCount ( unsigned long  count = 1)
inline

Increment the total number of items updated between a start stop.

Definition at line 71 of file Teuchos_StackedTimer.hpp.

◆ accumulatedTime()

double Teuchos::BaseTimer::accumulatedTime ( ) const
inline

Get the total accumulated time since last reset or construction when the timer is running.

Definition at line 74 of file Teuchos_StackedTimer.hpp.

◆ setAccumulatedTime()

void Teuchos::BaseTimer::setAccumulatedTime ( double  accum = 0)
inline

Setter for accumulated time.

Definition at line 77 of file Teuchos_StackedTimer.hpp.

◆ accumulatedTimePerUpdate()

double Teuchos::BaseTimer::accumulatedTimePerUpdate ( ) const
inline

return the average time per item updated

This returns the time on average that the code spends updating an iteration. If it is running than it will not include the current time. It differs from accumulatedTimePerTimerCall in that it is meant to be timer per event other that start/stop, like mesh update

Returns
average time per iteration pair

Definition at line 87 of file Teuchos_StackedTimer.hpp.

◆ accumulatedTimePerTimerCall()

double Teuchos::BaseTimer::accumulatedTimePerTimerCall ( ) const
inline

return the average time per timer start/stop

This returns the time on average that the code spends between a call to start and stop. If it is running than it will not include the current time

Returns
average time per start/stop pair

Definition at line 103 of file Teuchos_StackedTimer.hpp.

◆ difference()

double Teuchos::BaseTimer::difference ( const BaseTimer from) const
inline

Return the difference between two timers in seconds,.

Parameters
[in]fromreference time you are computing difference from
Returns
my time - from times

Definition at line 117 of file Teuchos_StackedTimer.hpp.

◆ reset()

void Teuchos::BaseTimer::reset ( )
inline

Reset all the timer stats, throws if it is already running.

Definition at line 122 of file Teuchos_StackedTimer.hpp.


The documentation for this class was generated from the following file: