Commit 276cc675 authored by Micha Mueller's avatar Micha Mueller
Browse files

Perfevent bugfix: bring back calculateInterval method (which I prematurely deleted)

parent 0f453c7b
......@@ -232,3 +232,10 @@ void PerfSensorGroup::readAsync() {
}
_pendingTasks--;
}
uint64_t PerfSensorGroup::calculateIntervalValue(uint64_t previous, uint64_t current, uint64_t maxValue){
if(previous > current) { //overflow
return current + (maxValue - previous);
}
return current - previous;
}
......@@ -55,8 +55,10 @@ private:
bool _lastValid;
double _maxCorrection;
uint64_t calculateIntervalValue(uint64_t previous, uint64_t current, uint64_t maxValue);
};
uint64_t calculateIntervalValue(uint64_t previous, uint64_t current, uint64_t maxValue);
#endif /* PERFSENSORGROUP_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment