Constructor
Returns the last finished value
Sets the current value to val
Adds the given value to the current value
Increments the current value by one
Adds current value to the time window history. Calculates the new average and returns it
Contains the latest value to which new values are currently being added
Resolution that the output needs to be multiplied with
Sliding Average Time Class
SlidingAverageTime offers a few more functions. It is for the use case when you don't want to add one value at once, but instead add on top of the last value until push() is called, which should be done periodically. The class is aware of that period and adjusts the added values accordingly. You tell it how much time a single completed value corresponds to and what time output resultion you desire.
Usage Example