How to estimate download time remaining (accurately)?

前端 未结 7 1756
自闭症患者
自闭症患者 2020-11-28 01:13

Sure you could divide the remaining file size by the current download speed, but if your download speed fluctuates (and it will), this doesn\'t produce a very nice result.

7条回答
  •  生来不讨喜
    2020-11-28 01:50

    I use this equation I derived myself.

    • E(d) represents the estimated time left before download finishes;
    • S(d) represents the download size;
    • L represents the size of the part of the file that is already downloaded; and
    • r represents the calculated download speed.

    In VB.NET code:

    Dim ed As TimeSpan = TimeSpan.FromSeconds((sd - l) / r)
    

提交回复
热议问题