|
crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
A simple start/stop watch with high resolution. More...
#include <StartStopHR.hpp>
Construction | |
| StartStopHR () | |
| Constructor initializing the values. More... | |
Control functions | |
| void | start () |
| Starts the timer. More... | |
| void | stop () |
| Stops the timer. More... | |
| void | reset () |
| Resets the timer. More... | |
Getter | |
| std::string | totalStr () |
| Gets the total duration as formatted string. More... | |
Reset | |
| void | clear () |
| Resets the internal state of the timer. More... | |
Internal state | |
| std::chrono::high_resolution_clock::time_point | timePoint |
| (Time) point of start. More... | |
| std::chrono::high_resolution_clock::duration | duration |
| Duration of previous runs. More... | |
A simple start/stop watch with high resolution.
Accumulates the number of passed microseconds while runnning.
|
inline |
Constructor initializing the values.
|
inline |
|
inline |
|
inline |
Starts the timer.
Microseconds will be accumulated starting from now on.
If the timer is already running, it will first be stopped, i.e. the number of microseconds stored internally will be refreshed.
References crawlservpp::Helper::DateTime::now(), stop(), and timePoint.
|
inline |
Stops the timer.
The number of microseconds stored internally will be refreshed.
References duration, crawlservpp::Helper::DateTime::now(), and timePoint.
Referenced by start(), and totalStr().
|
inline |
Gets the total duration as formatted string.
If the timer is currenty running, it will first be stopped, i.e. the number of microseconds passed will be refreshed.
References duration, crawlservpp::Helper::DateTime::microsecondsToString(), stop(), and timePoint.
|
protected |
Duration of previous runs.
Equals std::chrono::high_resolution_clock::duration::zero() if no time has been measured yet (excluding the current run).
Referenced by clear(), reset(), stop(), and totalStr().
|
protected |
(Time) point of start.
Equals std::chrono::high_resolution_clock::time_point::min() if the timer has not been started yet or is currently stopped.
Referenced by clear(), reset(), start(), stop(), and totalStr().