ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Private Attributes | List of all members
util::Stopwatch Class Reference

#include <Stopwatch.h>

Public Member Functions

 Stopwatch (const char *tool_name)
 
void Reset ()
 Stop the stopwatch, and clear the results vector. More...
 
std::string Result (std::string method_name, std::string output_file="")
 
void Start ()
 Start the stopwatch. More...
 
StopwatchTimes Stop ()
 Stop the stopwatch, returning the CPU time. More...
 

Private Attributes

std::vector< StopwatchTimesm_results
 Stores time at every Stop. More...
 
bool m_running
 Stores the state - running or not. More...
 
TStopwatch m_sw
 The external stopwatch timer. More...
 
std::string m_tool_name
 The name of the tool using the Stopwatch. For use in printout. More...
 

Detailed Description

Definition at line 17 of file Stopwatch.h.

Constructor & Destructor Documentation

util::Stopwatch::Stopwatch ( const char *  tool_name)

Definition at line 12 of file Stopwatch.cpp.

Member Function Documentation

void util::Stopwatch::Reset ( )

Stop the stopwatch, and clear the results vector.

Definition at line 108 of file Stopwatch.cpp.

std::string util::Stopwatch::Result ( std::string  method_name,
std::string  output_file = "" 
)

Get the formatted results, including min, max, average, total If output_file has a length, will save a histogram to a pdf

Definition at line 38 of file Stopwatch.cpp.

void util::Stopwatch::Start ( )

Start the stopwatch.

Definition at line 18 of file Stopwatch.cpp.

util::StopwatchTimes util::Stopwatch::Stop ( )

Stop the stopwatch, returning the CPU time.

Definition at line 24 of file Stopwatch.cpp.

Member Data Documentation

std::vector<StopwatchTimes> util::Stopwatch::m_results
private

Stores time at every Stop.

Definition at line 36 of file Stopwatch.h.

bool util::Stopwatch::m_running
private

Stores the state - running or not.

Definition at line 38 of file Stopwatch.h.

TStopwatch util::Stopwatch::m_sw
private

The external stopwatch timer.

Definition at line 34 of file Stopwatch.h.

std::string util::Stopwatch::m_tool_name
private

The name of the tool using the Stopwatch. For use in printout.

Definition at line 41 of file Stopwatch.h.


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