farm-ng-core
farm_ng::StopwatchSingleton Class Reference

Stopwatch class for creating multiple, optionally concurrent, timers. More...

#include <stopwatch.h>

Classes

struct  StopwatchStats
 Container for statistics on stopwatch timers. More...
 

Public Member Functions

void start (std::string str)
 Start a new, named timer. More...
 
double stop (std::string str)
 Stops the named timer and returns the duration. More...
 
std::map< std::string, StopwatchStats > getStats ()
 Return container of stopwatch timer statistics. More...
 
void print ()
 Prints statistics of stopwatch timers. More...
 

Static Public Member Functions

static StopwatchSingleton & getInstance ()
 Returns an instance of the stopwatch timer. More...
 

Detailed Description

Stopwatch class for creating multiple, optionally concurrent, timers.

Member Function Documentation

◆ getInstance()

static StopwatchSingleton& farm_ng::StopwatchSingleton::getInstance ( )
inlinestatic

Returns an instance of the stopwatch timer.

◆ getStats()

std::map<std::string, StopwatchStats> farm_ng::StopwatchSingleton::getStats ( )
inline

Return container of stopwatch timer statistics.

◆ print()

void farm_ng::StopwatchSingleton::print ( )
inline

Prints statistics of stopwatch timers.

◆ start()

void farm_ng::StopwatchSingleton::start ( std::string  str)
inline

Start a new, named timer.

◆ stop()

double farm_ng::StopwatchSingleton::stop ( std::string  str)
inline

Stops the named timer and returns the duration.


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