32 #ifndef TIMER_STARTSTOP_HPP_ 33 #define TIMER_STARTSTOP_HPP_ 35 #include "../Helper/DateTime.hpp" 114 :
timePoint(std::chrono::steady_clock::time_point::min()),
127 if(this->
timePoint != std::chrono::steady_clock::time_point::min()) {
143 this->
timePoint = std::chrono::steady_clock::time_point::min();
151 this->
timePoint = std::chrono::steady_clock::time_point::min();
152 this->
duration = std::chrono::steady_clock::duration::zero();
166 if(this->
timePoint != std::chrono::steady_clock::time_point::min()) {
171 std::chrono::duration_cast<std::chrono::milliseconds>(
179 this->
timePoint = std::chrono::steady_clock::time_point{};
180 this->
duration = std::chrono::steady_clock::duration{};
std::chrono::steady_clock::time_point timePoint
(Time) point of start.
Definition: StartStop.hpp:90
void clear()
Resets the internal state of the timer.
Definition: StartStop.hpp:178
void stop()
Stops the timer.
Definition: StartStop.hpp:140
std::string totalStr()
Gets the total duration as formatted string.
Definition: StartStop.hpp:165
void reset()
Resets the timer.
Definition: StartStop.hpp:150
std::string now()
Formats the current date/time as string in the format YYYY-MM-DD HH:MM:SS.
Definition: DateTime.hpp:1045
Namespace for timers.
Definition: Simple.hpp:40
StartStop()
Constructor initializing the values.
Definition: StartStop.hpp:113
A simple start/stop watch.
Definition: StartStop.hpp:52
std::chrono::steady_clock::duration duration
Duration of previous runs.
Definition: StartStop.hpp:97
std::string millisecondsToString(std::uint64_t milliseconds)
Converts milliseconds into a well-formatted string.
Definition: DateTime.hpp:933
void start()
Starts the timer.
Definition: StartStop.hpp:126