|
SUNphi
1.0
|
#include <Timer.hpp>
Public Types | |
| enum | { UNSTOPPABLE, STOPPABLE } |
| Defines whether the timer can be stopped or not. | |
Public Member Functions | |
| Timer & | operator[] (const char *subName) |
| Gets reference to the mapped sub timer. More... | |
| bool | hasChildren () const |
| Checks if has children. | |
| bool | hasRunningChildren () const |
| Checks if has running children. | |
| const Timer & | father () const |
| Gets a reference to the father. | |
| template<typename... Ts> | |
| decltype(auto) | father (Ts &&...ts) |
| const bool & | isStarted () const |
| Returns whether the timer is started. | |
| void | start () |
| Explicitly starts the stopwatch. | |
| Duration | currentMeasure () const |
| Returns the last measured or the current one. | |
| Duration | cumulativeMeasure () const |
| Returns the total measured time, including current one if is running. | |
| Duration | averageMeasure () const |
| Average measure. | |
| void | stop () |
| Stop the stopwatch. | |
| Timer (const char *name, Timer *father=nullptr, const bool isStoppableFlag=STOPPABLE) | |
| Builds the stopwatch. More... | |
Public Attributes | |
| const char * | name |
| Name of the timer. | |
| const bool | isStoppable |
| Mark whether the stopwatch can be stopped. | |
Static Public Attributes | |
| static constexpr Timer * | NO_FATHER |
| Used to mark that there is no father. More... | |
Private Types | |
| enum | Started { IMPLICITLY, EXPLICITLY } |
| Started mode: was it started by a children or explicityly? | |
Private Member Functions | |
| void | innerStart (const bool implExpl) |
| Common start. More... | |
| void | childrenStarted () |
| Starts through a children. | |
Private Attributes | |
| int | nMeasures |
| Number of intervals measured. | |
| bool | isStartedFlag |
| Mark if the stopwatch is started. | |
| Instant | lastMomentStarted |
| Last moment the stopwatch was started. | |
| Instant | lastMomentStopped {lastMomentStarted} |
| Last moment the stopwatch was stopped. | |
| Duration | _cumulativeMeasure |
| Cumulative time for which the timer has been let running. | |
| Timer * | _father |
| Father of current timer. | |
| int | nStartedChildren {0} |
| Number of children measuring. | |
| MapWithCStrKey< Timer > | children |
| Children. | |
| bool | isExplicitlyStarted |
| Determine whether it was explicitly started (or from a children) | |
Splittable stopwatch
If the stopwatch is created with isStoppable set to true, it cannot be stopped and is automatically started
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
static |