Storm
A Modern Probabilistic Model Checker
|
A class that provides convenience operations to display run times. More...
#include <Stopwatch.h>
Public Types | |
typedef decltype(std::chrono::duration_cast< std::chrono::seconds >(std::chrono::seconds::zero()).count()) | SecondType |
typedef decltype(std::chrono::duration_cast< std::chrono::milliseconds >(std::chrono::milliseconds::zero()).count()) | MilisecondType |
typedef decltype(std::chrono::duration_cast< std::chrono::nanoseconds >(std::chrono::nanoseconds::zero()).count()) | NanosecondType |
Public Member Functions | |
Stopwatch (bool startNow=false) | |
Constructor. | |
SecondType | getTimeInSeconds () const |
Gets the measured time in seconds. | |
MilisecondType | getTimeInMilliseconds () const |
Gets the measured time in milliseconds. | |
NanosecondType | getTimeInNanoseconds () const |
Gets the measured time in nanoseconds. | |
void | addToTime (std::chrono::nanoseconds timeNanoseconds) |
Add given time to measured time. | |
void | add (Stopwatch const &other) |
Adds the value of the (stopped) watch to the accumulated time of this watch. | |
void | stop () |
Stop stopwatch and add measured time to total time. | |
void | start () |
Start stopwatch (again) and start measuring time. | |
void | reset () |
Reset the stopwatch. | |
void | restart () |
Reset the stopwatch and immediately start it. | |
bool | stopped () const |
Retrieves whether the watch is stopped. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, Stopwatch const &stopwatch) |
A class that provides convenience operations to display run times.
Definition at line 14 of file Stopwatch.h.
typedef decltype(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::milliseconds::zero()).count()) storm::utility::Stopwatch::MilisecondType |
Definition at line 17 of file Stopwatch.h.
typedef decltype(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::nanoseconds::zero()).count()) storm::utility::Stopwatch::NanosecondType |
Definition at line 18 of file Stopwatch.h.
typedef decltype(std::chrono::duration_cast<std::chrono::seconds>(std::chrono::seconds::zero()).count()) storm::utility::Stopwatch::SecondType |
Definition at line 16 of file Stopwatch.h.
storm::utility::Stopwatch::Stopwatch | ( | bool | startNow = false | ) |
Constructor.
startNow | If true, the stopwatch starts right away. |
Definition at line 6 of file Stopwatch.cpp.
void storm::utility::Stopwatch::add | ( | Stopwatch const & | other | ) |
Adds the value of the (stopped) watch to the accumulated time of this watch.
Definition at line 37 of file Stopwatch.cpp.
void storm::utility::Stopwatch::addToTime | ( | std::chrono::nanoseconds | timeNanoseconds | ) |
Add given time to measured time.
timeNanoseconds | Additional time in nanoseconds. |
Definition at line 33 of file Stopwatch.cpp.
Stopwatch::MilisecondType storm::utility::Stopwatch::getTimeInMilliseconds | ( | ) | const |
Gets the measured time in milliseconds.
Definition at line 21 of file Stopwatch.cpp.
Stopwatch::NanosecondType storm::utility::Stopwatch::getTimeInNanoseconds | ( | ) | const |
Gets the measured time in nanoseconds.
Definition at line 29 of file Stopwatch.cpp.
Stopwatch::SecondType storm::utility::Stopwatch::getTimeInSeconds | ( | ) | const |
Gets the measured time in seconds.
Definition at line 13 of file Stopwatch.cpp.
void storm::utility::Stopwatch::reset | ( | ) |
Reset the stopwatch.
Definition at line 54 of file Stopwatch.cpp.
void storm::utility::Stopwatch::restart | ( | ) |
Reset the stopwatch and immediately start it.
Definition at line 59 of file Stopwatch.cpp.
void storm::utility::Stopwatch::start | ( | ) |
Start stopwatch (again) and start measuring time.
Definition at line 48 of file Stopwatch.cpp.
void storm::utility::Stopwatch::stop | ( | ) |
Stop stopwatch and add measured time to total time.
Definition at line 42 of file Stopwatch.cpp.
bool storm::utility::Stopwatch::stopped | ( | ) | const |
Retrieves whether the watch is stopped.
Definition at line 64 of file Stopwatch.cpp.
|
friend |
Definition at line 68 of file Stopwatch.cpp.