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