mlpack  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
mlpack::Timers Class Reference

Public Member Functions

 Timers ()
 Nothing to do for the constructor. More...
 
std::map< std::string, std::chrono::microseconds > & GetAllTimers ()
 Returns a copy of all the timers used via this interface. More...
 
bool GetState (std::string timerName)
 Returns state of the given timer. More...
 
std::chrono::microseconds GetTimer (const std::string &timerName)
 Returns a copy of the timer specified. More...
 
void PrintTimer (const std::string &timerName)
 Prints the specified timer. More...
 
void StartTimer (const std::string &timerName)
  * Initializes a timer, available like a normal value specified on  * the command line. More...
 
void StopTimer (const std::string &timerName)
  * Halts the timer, and replaces it's value with  * the delta time from it's start   *   *. More...
 

Private Member Functions

std::chrono::high_resolution_clock::time_point GetTime ()
 

Private Attributes

std::map< std::string, std::chrono::microseconds > timers
 A map of all the timers that are being tracked. More...
 
std::map< std::string, std::chrono::high_resolution_clock::time_point > timerStartTime
 A map for the starting values of the timers. More...
 
std::map< std::string, bool > timerState
 A map that contains whether or not each timer is currently running. More...
 

Detailed Description

Definition at line 72 of file timers.hpp.

Constructor & Destructor Documentation

mlpack::Timers::Timers ( )
inline

Nothing to do for the constructor.

Definition at line 76 of file timers.hpp.

References string().

Member Function Documentation

std::map<std::string, std::chrono::microseconds>& mlpack::Timers::GetAllTimers ( )

Returns a copy of all the timers used via this interface.

bool mlpack::Timers::GetState ( std::string  timerName)

Returns state of the given timer.

Parameters
timerNameThe name of the timer in question.
std::chrono::high_resolution_clock::time_point mlpack::Timers::GetTime ( )
private
std::chrono::microseconds mlpack::Timers::GetTimer ( const std::string timerName)

Returns a copy of the timer specified.

Parameters
timerNameThe name of the timer in question.
void mlpack::Timers::PrintTimer ( const std::string timerName)

Prints the specified timer.

If it took longer than a minute to complete the timer will be displayed in days, hours, and minutes as well.

Parameters
timerNameThe name of the timer in question.
void mlpack::Timers::StartTimer ( const std::string timerName)

 * Initializes a timer, available like a normal value specified on  * the command line.

  Timers are of type timeval. If a timer is started, then stopped, then re-started, then stopped, the final timer value will be the length of both runs of the timer.  *  *

Parameters
timerNameThe name of the timer in question.  
void mlpack::Timers::StopTimer ( const std::string timerName)

 * Halts the timer, and replaces it's value with  * the delta time from it's start   *   *.

Parameters
timerNameThe name of the timer in question.  

Member Data Documentation

std::map<std::string, std::chrono::microseconds> mlpack::Timers::timers
private

A map of all the timers that are being tracked.

Definition at line 125 of file timers.hpp.

std::map<std::string, std::chrono::high_resolution_clock::time_point> mlpack::Timers::timerStartTime
private

A map for the starting values of the timers.

Definition at line 130 of file timers.hpp.

std::map<std::string, bool> mlpack::Timers::timerState
private

A map that contains whether or not each timer is currently running.

Definition at line 127 of file timers.hpp.


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