Calculate Time Remaining

后端 未结 16 2661
一生所求
一生所求 2020-12-04 08:22

What\'s a good algorithm for determining the remaining time for something to complete? I know how many total lines there are, and how many have completed already, how shoul

16条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 09:09

    there is no standard algorithm i know of, my sugestion would be:

    • Create a variable to save the %
    • Calculate the complexity of the task you wish to track(or an estimative of it)
    • Put increments to the % from time to time as you would see fit given the complexity.

    You probably seen programs where the load bar runs much faster in one point than in another. Well that's pretty much because this is how they do it. (though they probably just put increments at regular intervals in the main wrapper)

提交回复
热议问题