estTotalDuration property

Duration estTotalDuration

Estimate duration for entire download process, using averageTPS

Uses an exponentially smoothed moving average algorithm instead of a linear average algorithm. This should lead to more accurate duration calculations, but may not return the same result as expected. The full original algorithm (written in Python) can be found at https://stackoverflow.com/a/54264570/11846040.

Implementation

Duration get estTotalDuration => Duration(
      seconds: (maxTiles / averageTPS.clamp(1, double.infinity)).round(),
    );