|
HermesCommon
3.0
|
Class using time measurement Can be used directly (is not abstract), so one can use e.g. this in a program: Mixins::TimeMeasurable time; time.tick(); <– do whatever you want to measure execution time of –> std::cout << "Whatever took " << time.last() << "seconds to execute.";. More...
#include <mixins.h>
Inheritance diagram for Hermes::Mixins::TimeMeasurable:Public Types | |
| enum | TimerPeriodTickType { HERMES_ACCUMULATE, HERMES_SKIP } |
| Tick type. Used by the class Hermes::TimePeriod. More... | |
Public Member Functions | |
| TimeMeasurable (const char *name=nullptr) | |
| Constructs internal structures and starts measuring. | |
| const TimeMeasurable & | reset () |
| Resets accumulated time. | |
| const TimeMeasurable & | tick_reset () |
| Starts a new_ period and resets accumulated time. | |
| const TimeMeasurable & | tick (TimeMeasurable::TimerPeriodTickType type=HERMES_ACCUMULATE) |
| Starts/ends a new_ period. | |
| const std::string & | name () const |
| Returns a name of the time period if any. | |
| double | accumulated () const |
| Returns accumulated time (in seconds). | |
| std::string | accumulated_str () const |
| Returns accumulated time in human readable form. | |
| double | last () const |
| Returns last measured period (in seconds). More... | |
| std::string | last_str () const |
| Returns last measured period in human readable form. | |
Class using time measurement Can be used directly (is not abstract), so one can use e.g. this in a program: Mixins::TimeMeasurable time; time.tick(); <– do whatever you want to measure execution time of –> std::cout << "Whatever took " << time.last() << "seconds to execute.";.
| double Hermes::Mixins::TimeMeasurable::last | ( | ) | const |
Returns last measured period (in seconds).
Definition at line 650 of file mixins.cpp.