Developer Documentation
ACG::StopWatch Class Reference

#include <ACG/Utils/StopWatch.hh>

Public Member Functions

 StopWatch ()
 Constructor. More...
 
 ~StopWatch ()
 Destructor. More...
 
void start ()
 Start time measurement. More...
 
double restart ()
 Restart, return time elapsed until now. More...
 
double stop ()
 Stop time measurement, return time. More...
 
double elapsed () const
 Get the total time in milli-seconds (watch has to be stopped). More...
 

Private Member Functions

timeval current_time () const
 

Private Attributes

timeval starttime_
 
timeval endtime_
 

Detailed Description

This class can be used for measuring time, providing milli-second precision by using the gettimeofday() funtion. It is e.g. used in the class ACG::TimedTracing.

Definition at line 90 of file StopWatch.hh.

Constructor & Destructor Documentation

◆ StopWatch()

ACG::StopWatch::StopWatch ( )
inline

Constructor.

Definition at line 95 of file StopWatch.hh.

◆ ~StopWatch()

ACG::StopWatch::~StopWatch ( )
inline

Destructor.

Definition at line 107 of file StopWatch.hh.

Member Function Documentation

◆ current_time()

timeval ACG::StopWatch::current_time ( ) const
inlineprivate

Definition at line 160 of file StopWatch.hh.

◆ elapsed()

double ACG::StopWatch::elapsed ( ) const
inline

Get the total time in milli-seconds (watch has to be stopped).

Definition at line 143 of file StopWatch.hh.

◆ restart()

double ACG::StopWatch::restart ( )
inline

Restart, return time elapsed until now.

Definition at line 119 of file StopWatch.hh.

◆ start()

void ACG::StopWatch::start ( )
inline

Start time measurement.

Definition at line 110 of file StopWatch.hh.

◆ stop()

double ACG::StopWatch::stop ( )
inline

Stop time measurement, return time.

Definition at line 132 of file StopWatch.hh.

Member Data Documentation

◆ endtime_

timeval ACG::StopWatch::endtime_
private

Definition at line 166 of file StopWatch.hh.

◆ starttime_

timeval ACG::StopWatch::starttime_
private

Definition at line 166 of file StopWatch.hh.


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