crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
A simple start/stop watch. More...
#include <StartStop.hpp>
Construction | |
StartStop () | |
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::steady_clock::time_point | timePoint |
(Time) point of start. More... | |
std::chrono::steady_clock::duration | duration |
Duration of previous runs. More... | |
A simple start/stop watch.
Accumulates the number of passed milliseconds while running.
|
inline |
Constructor initializing the values.
|
inline |
|
inline |
|
inline |
Starts the timer.
Milliseconds will be accumulated starting from now on.
If the timer is already running, it will first be stopped, i.e. the number of milliseconds stored internally will be refreshed.
References crawlservpp::Helper::DateTime::now(), stop(), and timePoint.
Referenced by crawlservpp::Module::Crawler::Thread::onReset(), and crawlservpp::Module::Crawler::Thread::onTick().
|
inline |
Stops the timer.
The number of milliseconds stored internally will be refreshed
References duration, crawlservpp::Helper::DateTime::now(), and timePoint.
Referenced by crawlservpp::Module::Crawler::Thread::onReset(), 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 milliseconds passed will be refreshed.
References duration, crawlservpp::Helper::DateTime::millisecondsToString(), stop(), and timePoint.
Referenced by crawlservpp::Module::Crawler::Thread::onReset().
|
protected |
Duration of previous runs.
Equals std::chrono::steady_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::steady_clock::time_point::min()
if the timer has not been started yet or is currently stopped.
Referenced by clear(), reset(), start(), stop(), and totalStr().