Go to the documentation of this file.
35 if (fabs(newHorizon -
horizon) >= 1e-3) {
47 return total += howMany;
59 const int staleSlots =
static_cast<int>(deltas);
60 for (
int i = 0, s = lastSlot + 1; i < staleSlots; ++i, ++s) {
double current_dtime
the current UNIX time in seconds (with microsecond precision)
int total
number of remembered events (possibly stale)
void configure(double horizonSeconds)
0=remember nothing; -1=forget nothing; new value triggers clear()
std::vector< int > counters
events per delta (possibly stale)
void clear()
forgets all events
const int precision
#counting slots, controls measur. accuracy
double lastTime
time of the last update
double delta
sub-interval duration = horizon/precision
double horizon
read-only memory horizon in seconds; older events are forgotten
int count(int howMany)
count fresh, return #events remembered