41 std::shared_ptr<std::chrono::high_resolution_clock::duration>
74 std::string msg =
"Total elapsed seconds: " 83 std::string msg =
"Total elapsed milliseconds: " 93 std::string msg =
"Total elapsed time: " 103 std::unique_ptr<std::chrono::high_resolution_clock::time_point>
tStart;
109 std::unique_ptr<std::chrono::high_resolution_clock::time_point>
tEnd;
bool hasNulls()
Check if the time watcher has null start or end time points.
Definition: TimeWatcher.cpp:92
A time watcher can be used to perform and report time measures.
Definition: TimeWatcher.h:13
long getElapsedMillis()
Obtain the elapsed time as the integer number of milliseconds.
Definition: TimeWatcher.cpp:46
double getElapsedDecimalSeconds()
Obtain the elapsed time as the real number of seconds.
Definition: TimeWatcher.cpp:37
std::unique_ptr< std::chrono::high_resolution_clock::time_point > tEnd
End time point.
Definition: TimeWatcher.h:109
std::string getElapsedFormat()
Obtain the elapsed time as a string with format "HH:MM:SS".
Definition: TimeWatcher.cpp:59
long getElapsedNanos()
Obtain the elapsed time as the integer number of nanoseconds.
Definition: TimeWatcher.cpp:52
void stop()
Stop the time watcher, which sets the ending point for a time measure.
Definition: TimeWatcher.cpp:22
std::shared_ptr< std::chrono::high_resolution_clock::duration > getElapsedTime()
Obtain the elapsed time as the difference between the last start() and the last stop() invocations...
Definition: TimeWatcher.cpp:31
void reportMillis(std::string msg="Total elapsed milliseconds: ")
Report elapsed seconds through specified output stream.
Definition: TimeWatcher.cpp:78
TimeWatcher()
Instantiate a time watcher.
Definition: TimeWatcher.cpp:8
void start()
Start the time watcher, which sets the starting point for a time measure.
Definition: TimeWatcher.cpp:15
long getElapsedSeconds()
Obtain the elapsed time as the integer number of seconds.
Definition: TimeWatcher.cpp:40
void reportFormat(std::string msg="Total elapsed time: ")
Report elapsed time through specified output stream using "HH:MM:SS" format.
Definition: TimeWatcher.cpp:84
void reportSeconds(std::string msg="Total elapsed seconds: ")
Report elapsed seconds through specified output stream.
Definition: TimeWatcher.cpp:72
std::unique_ptr< std::chrono::high_resolution_clock::time_point > tStart
Start time point.
Definition: TimeWatcher.h:103