mirror of
https://github.com/usatiuk/backup.git
synced 2025-10-26 17:37:47 +01:00
init
This commit is contained in:
20
src/RunningDiffAverage.cpp
Normal file
20
src/RunningDiffAverage.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// 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();
|
||||
}
|
||||
Reference in New Issue
Block a user