SOT
Public Member Functions | List of all members
sot::StopWatch Class Reference

Stop watch class. More...

#include <utils.h>

Public Member Functions

 StopWatch ()
 Constructor. More...
 
void start ()
 Starts the watch. More...
 
double stop ()
 Stops the watch and returns the time elapsed. More...
 

Detailed Description

Stop watch class.

This class can be used to measure the elapsed time (in seconds) for different strategies or other functions. It is a wrapper around std::chrono.

Author
David Eriksson, dme65.nosp@m.@cor.nosp@m.nell..nosp@m.edu

Constructor & Destructor Documentation

sot::StopWatch::StopWatch ( )
inline

Constructor.

Initializes a watch that isn't started

Member Function Documentation

void sot::StopWatch::start ( )
inline

Starts the watch.

Exceptions
std::logic_errorIf the watch has already been started
double sot::StopWatch::stop ( )
inline

Stops the watch and returns the time elapsed.

Returns
Time elapsed (seconds) since the watch was started
Exceptions
std::logic_errorIf the watch hasn't already been started

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