mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 09:27:48 +01:00
21 lines
526 B
C++
21 lines
526 B
C++
//
|
|
// Created by Stepan Usatiuk on 12.05.2023.
|
|
//
|
|
|
|
#include "RunningDiffAverage.h"
|
|
|
|
RunningDiffAverage::RunningDiffAverage(std::function<unsigned long long int()> getFunc, int max, int ms)
|
|
: runningAverage(
|
|
[this, get = std::move(getFunc)] {
|
|
auto cur = get();
|
|
auto calc = cur - prev;
|
|
prev = cur;
|
|
return calc;
|
|
},
|
|
max, ms) {
|
|
}
|
|
|
|
unsigned long long RunningDiffAverage::get() {
|
|
return runningAverage.get();
|
|
}
|