A moving average. More...
Instance Methods | |
(void) | - add: |
Adds a sample. More... | |
(long long) | - average |
Gets the average. More... | |
(instancetype) | - initWithLookback: |
Initializes a new instance of the FMLiveSwitchMovingAverage class. More... | |
Class Methods | |
(FMLiveSwitchMovingAverage *) | + movingAverageWithLookback: |
Initializes a new instance of the FMLiveSwitchMovingAverage class. More... | |
A moving average.
- (void) add: | (long long) | value |
Adds a sample.
value | The value to add. |
- (long long) average |
Gets the average.
- (instancetype) initWithLookback: | (int) | lookback |
Initializes a new instance of the FMLiveSwitchMovingAverage class.
lookback | The number of lookback values. |
+ (FMLiveSwitchMovingAverage*) movingAverageWithLookback: | (int) | lookback |
Initializes a new instance of the FMLiveSwitchMovingAverage class.
lookback | The number of lookback values. |