Smart progress bar ETA computation

后端 未结 11 518
谎友^
谎友^ 2020-12-22 16:10

In many applications, we have some progress bar for a file download, for a compression task, for a search, etc. We all often use progress bars to let users know something is

11条回答
  •  再見小時候
    2020-12-22 16:17

    I have tried and simplified your "easy"/"wrong"/"OK" formula and it works best for me:

    t / p - t
    

    In Python:

    >>> done=0.3; duration=10; "time left: %i" % (duration / done - duration)
    'time left: 23'
    

    That saves one op compared to (dur*(1-done)/done). And, in the edge case you describe, possibly ignoring the dialog for 30 minutes extra hardly matters after waiting all night.

    Comparing this simple method to the one used by Transmission, I found it to be up to 72% more accurate.

提交回复
热议问题