ToolDAQFramework
|
#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< StopwatchTimes > | m_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... | |
Definition at line 17 of file Stopwatch.h.
util::Stopwatch::Stopwatch | ( | const char * | tool_name | ) |
Definition at line 12 of file Stopwatch.cpp.
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.
|
private |
Stores time at every Stop.
Definition at line 36 of file Stopwatch.h.
|
private |
Stores the state - running or not.
Definition at line 38 of file Stopwatch.h.
|
private |
The external stopwatch timer.
Definition at line 34 of file Stopwatch.h.
|
private |
The name of the tool using the Stopwatch. For use in printout.
Definition at line 41 of file Stopwatch.h.