AceUtils
0.2
Useful Arduino utilties which are too small for separate libraries.
|
Helper class to collect timing statistics such as min, max, average, and exponential-decay average. More...
#include <TimingStats.h>
Public Member Functions | |
TimingStats () | |
Constructor. More... | |
TimingStats (const TimingStats &)=default | |
TimingStats & | operator= (const TimingStats &)=default |
void | reset () |
Reset the object to its initial state, except mCounter which is never reset. | |
uint16_t | getMax () const |
Return the maximum since the last reset(). | |
uint16_t | getMin () const |
Return the minium since the last reset(). | |
uint16_t | getAvg () const |
Return the average since the last reset(). More... | |
uint16_t | getExpDecayAvg () const |
An exponential decay average since the last reset(). | |
uint16_t | getCount () const |
Number of times update() was called since last reset(). | |
uint16_t | getCounter () const |
Number of times update() was called from the beginning of time. More... | |
void | update (uint16_t duration) |
Add the given duration (often in milliseconds) to the statistics. | |
Helper class to collect timing statistics such as min, max, average, and exponential-decay average.
Definition at line 36 of file TimingStats.h.
|
inline |
|
inline |
Return the average since the last reset().
Returns 0 if update() has never been called.
Definition at line 69 of file TimingStats.h.
|
inline |
Number of times update() was called from the beginning of time.
Never reset. This is useful to determining how many times update() was called since it was last checked from the client code.
Definition at line 82 of file TimingStats.h.