Browse Source

Merge pull request #14737 from jagannatharjun/revert

Revert "Change clamping of update interval of SpeedPlotView::Averager"
adaptive-webui-19844
Chocobo1 4 years ago committed by GitHub
parent
commit
2b8e50b296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/gui/properties/speedplotview.cpp

3
src/gui/properties/speedplotview.cpp

@ -120,7 +120,8 @@ bool SpeedPlotView::Averager::push(const SampleData &sampleData) @@ -120,7 +120,8 @@ bool SpeedPlotView::Averager::push(const SampleData &sampleData)
// system may go to sleep, that can cause very big elapsed interval
const milliseconds updateInterval {static_cast<int64_t>(BitTorrent::Session::instance()->refreshInterval() * 1.25)};
const milliseconds elapsed {std::min(milliseconds {m_lastSampleTime.elapsed()}, updateInterval)};
const milliseconds maxElapsed {std::max(updateInterval, m_resolution)};
const milliseconds elapsed {std::min(milliseconds {m_lastSampleTime.elapsed()}, maxElapsed)};
if (elapsed < m_resolution)
return false; // still accumulating

Loading…
Cancel
Save