CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StopWatch Class Reference

#include <algorithm.h>

Inheritance diagram for StopWatch:
Collaboration diagram for StopWatch:

Public Member Functions

 StopWatch ()
 
void Start ()
 
void Stop ()
 
void Reset ()
 
double GetTime () const
 

Private Attributes

bool running_
 
timeval start_
 
timeval end_
 

Additional Inherited Members

- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Detailed Description

Very simple StopWatch implementation. Currently the implementation does not allow a restart of a stopped watch. You should always reset the clock before you reuse it.

Stopwatch watch(); watch.Start(); // do nasty thing watch.Stop(); printf("%f", watch.GetTime());

Definition at line 112 of file algorithm.h.

Constructor & Destructor Documentation

StopWatch::StopWatch ( )
inline

Definition at line 114 of file algorithm.h.

Member Function Documentation

double StopWatch::GetTime ( ) const

Definition at line 76 of file algorithm.cc.

Referenced by swissknife::CommandMigrate::AnalyzeCatalogStatistics(), and swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::operator()().

Here is the call graph for this function:

Here is the caller graph for this function:

void StopWatch::Reset ( )

Definition at line 69 of file algorithm.cc.

Referenced by swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::operator()().

Here is the caller graph for this function:

void StopWatch::Start ( )

Definition at line 53 of file algorithm.cc.

Referenced by swissknife::CommandMigrate::DoMigrationAndCommit(), swissknife::CommandMigrate::Main(), and swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::operator()().

Here is the call graph for this function:

Here is the caller graph for this function:

void StopWatch::Stop ( )

Definition at line 61 of file algorithm.cc.

Referenced by swissknife::CommandMigrate::DoMigrationAndCommit(), swissknife::CommandMigrate::Main(), and swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::operator()().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

timeval StopWatch::end_
private

Definition at line 124 of file algorithm.h.

bool StopWatch::running_
private

Definition at line 123 of file algorithm.h.

timeval StopWatch::start_
private

Definition at line 124 of file algorithm.h.


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