|
MCKL
Monte Carlo Kernel Library
|
StopWatch as an adapter of C++ standard library compatible clock. More...
#include <mckl/utility/stop_watch.hpp>
Public Types | |
| using | clock_type = ClockType |
Public Member Functions | |
| StopWatchClockAdapter () | |
| std::uint64_t | cycles () const |
| Return the accumulated cycles. More... | |
| double | hours () const |
Equivalent to time<double, std::ratio<3600>>() More... | |
| double | microseconds () const |
Equivalent to time<double, std::micro>() More... | |
| double | milliseconds () const |
Equivalent to time<double, std::milli>() More... | |
| double | minutes () const |
Equivalent to time<double, std::ratio<60>>() More... | |
| double | nanoseconds () const |
Equivalent to time<double, std::nano>() More... | |
| void | reset () |
| Stop and reset the elapsed time to zero. More... | |
| bool | running () const |
| If the watch is running. More... | |
| double | seconds () const |
Equivalent to time<double, std::ratio<1>>() More... | |
| bool | start () |
| Start the watch, no effect if already started. More... | |
| bool | stop () |
| Stop the watch, no effect if already stopped. More... | |
| clock_type::duration const | time () const |
| Return the accumulated elapsed time in its native format. More... | |
| template<typename Rep , typename Period > | |
| Rep | time () const |
| Return the accumulated elapsed time in specified format. More... | |
Static Public Member Functions | |
| static constexpr bool | has_cycles () |
| If cycle counting is supported. More... | |
StopWatch as an adapter of C++ standard library compatible clock.
Definition at line 166 of file stop_watch.hpp.
| using mckl::StopWatchClockAdapter< ClockType >::clock_type = ClockType |
Definition at line 169 of file stop_watch.hpp.
|
inline |
Definition at line 171 of file stop_watch.hpp.
|
inline |
Return the accumulated cycles.
Definition at line 248 of file stop_watch.hpp.
|
inlinestatic |
If cycle counting is supported.
If this function returns true, then cycles() will return the number of accumulated cycles. Otherwise, it will always returns zero.
Definition at line 182 of file stop_watch.hpp.
|
inline |
Equivalent to time<double, std::ratio<3600>>()
Definition at line 278 of file stop_watch.hpp.
|
inline |
Equivalent to time<double, std::micro>()
Definition at line 266 of file stop_watch.hpp.
|
inline |
Equivalent to time<double, std::milli>()
Definition at line 269 of file stop_watch.hpp.
|
inline |
Equivalent to time<double, std::ratio<60>>()
Definition at line 275 of file stop_watch.hpp.
|
inline |
Equivalent to time<double, std::nano>()
Definition at line 263 of file stop_watch.hpp.
|
inline |
Stop and reset the elapsed time to zero.
Definition at line 239 of file stop_watch.hpp.
|
inline |
If the watch is running.
If start() has been called and no stop() call since, then it is running, otherwise it is stoped.
Definition at line 196 of file stop_watch.hpp.
|
inline |
Equivalent to time<double, std::ratio<1>>()
Definition at line 272 of file stop_watch.hpp.
|
inline |
Start the watch, no effect if already started.
true if it is started by this call, and the elapsed time will be incremented next time stop() is called. The increment will be relative to the time point of this call. false if it is already started earlier. Definition at line 204 of file stop_watch.hpp.
|
inline |
Stop the watch, no effect if already stopped.
true if it is stoped by this call, and the elapsed time has been incremented. false if it is already stopped or wasn't started before. Definition at line 222 of file stop_watch.hpp.
|
inline |
Return the accumulated elapsed time in its native format.
Definition at line 251 of file stop_watch.hpp.
|
inline |
Return the accumulated elapsed time in specified format.
Definition at line 255 of file stop_watch.hpp.
1.8.13