DART  6.7.3
dart::common::Timer Class Reference

The implementation of Timer class. More...

#include <Timer.hpp>

Public Member Functions

 Timer (const std::string &_name="Noname Timer")
 Default constructor. More...
 
virtual ~Timer ()
 Default destructor. More...
 
void start ()
 Start timer. More...
 
bool isStarted () const
 Returns whether the timer is started. More...
 
void stop ()
 Stop the timer. More...
 
double getElapsedTime ()
 Return elapsed time in seconds since startTimer() More...
 
double getLastElapsedTime () const
 Return last elapsed time in seconds. More...
 
double getTotalElapsedTime () const
 Return total elapsed time in seconds. More...
 
void print ()
 Print results. More...
 

Static Public Member Functions

static double getWallTime ()
 Return the current time of the system in seconds. More...
 

Private Attributes

int mCount
 
timeval mTimeVal
 
double mStartedTime
 
double mStoppedTime
 
double mLastElapsedTime
 
double mTotalElapsedTime
 
std::string mName
 
bool mIsStarted
 

Detailed Description

The implementation of Timer class.

This is a definition of mTimer class. For measure the time, gettimeofday() api is used

Constructor & Destructor Documentation

◆ Timer()

dart::common::Timer::Timer ( const std::string &  _name = "Noname Timer")
explicit

Default constructor.

◆ ~Timer()

dart::common::Timer::~Timer ( )
virtual

Default destructor.

Member Function Documentation

◆ getElapsedTime()

double dart::common::Timer::getElapsedTime ( )

Return elapsed time in seconds since startTimer()

See also
start()

◆ getLastElapsedTime()

double dart::common::Timer::getLastElapsedTime ( ) const

Return last elapsed time in seconds.

◆ getTotalElapsedTime()

double dart::common::Timer::getTotalElapsedTime ( ) const

Return total elapsed time in seconds.

◆ getWallTime()

double dart::common::Timer::getWallTime ( )
static

Return the current time of the system in seconds.

◆ isStarted()

bool dart::common::Timer::isStarted ( ) const

Returns whether the timer is started.

◆ print()

void dart::common::Timer::print ( )

Print results.

◆ start()

void dart::common::Timer::start ( )

Start timer.

◆ stop()

void dart::common::Timer::stop ( )

Stop the timer.

Member Data Documentation

◆ mCount

int dart::common::Timer::mCount
private

◆ mIsStarted

bool dart::common::Timer::mIsStarted
private

◆ mLastElapsedTime

double dart::common::Timer::mLastElapsedTime
private

◆ mName

std::string dart::common::Timer::mName
private

◆ mStartedTime

double dart::common::Timer::mStartedTime
private

◆ mStoppedTime

double dart::common::Timer::mStoppedTime
private

◆ mTimeVal

timeval dart::common::Timer::mTimeVal
private

◆ mTotalElapsedTime

double dart::common::Timer::mTotalElapsedTime
private