Timer class to stop times.
More...
#include <Timer.h>
|
void | start () |
| start the timer.
|
|
long | stop () |
| Stops the timer and returns the time elapsed in nanoseconds since the last call to start.
|
|
void | reset () |
| Resets the timer to 0.
|
|
void | addTime (long nanoseconds) |
| Adds the given amount of nanoseconds to the total time.
|
|
long | getTotalTime () const |
| Get total accumulated time.
|
|
|
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.
|
|
Timer class to stop times.
◆ addTime()
void autopas::utils::Timer::addTime |
( |
long |
nanoseconds | ) |
|
Adds the given amount of nanoseconds to the total time.
- Parameters
-
◆ getDateStamp()
static std::string autopas::utils::Timer::getDateStamp |
( |
const std::string & |
format = "%Y-%m-%d_%H-%M-%S" | ) |
|
|
inlinestatic |
Create a date stamp for the current moment with the given format.
- Parameters
-
- Returns
- String representation of the current date in the given format.
◆ getTotalTime()
long autopas::utils::Timer::getTotalTime |
( |
| ) |
const |
|
inline |
Get total accumulated time.
- Returns
- Total time in nano seconds.
◆ stop()
long autopas::utils::Timer::stop |
( |
| ) |
|
Stops the timer and returns the time elapsed in nanoseconds since the last call to start.
It also adds the duration to the total time.
- Returns
- elapsed time in nanoseconds
The documentation for this class was generated from the following files: