60 static std::string
getDateStamp(
const std::string &format =
"%Y-%m-%d_%H-%M-%S") {
61 auto now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
62 std::ostringstream nowStrStr;
65 ss << std::put_time(localtime_r(&now, &unused), format.c_str());
73 std::chrono::high_resolution_clock::time_point _startTime;
83 bool _currentlyRunning =
false;
Timer class to stop times.
Definition: Timer.h:20
void start()
start the timer.
Definition: Timer.cpp:17
void reset()
Resets the timer to 0.
Definition: Timer.cpp:40
long getTotalTime() const
Get total accumulated time.
Definition: Timer.h:53
static std::string getDateStamp(const std::string &format="%Y-%m-%d_%H-%M-%S")
Create a date stamp for the current moment with the given format.
Definition: Timer.h:60
void addTime(long nanoseconds)
Adds the given amount of nanoseconds to the total time.
Definition: Timer.cpp:42
long stop()
Stops the timer and returns the time elapsed in nanoseconds since the last call to start.
Definition: Timer.cpp:25
In this namespace some helper classes and functions can be found used inside of AutoPas.
Definition: namespaces.h:44