Calculate Time Remaining

后端 未结 16 2646
一生所求
一生所求 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:18

    Where time$("ms") represents the current time in milliseconds since 00:00:00.00, and lof represents the total lines to process, and x represents the current line:

    if Ln>0 then
        Tn=Tn+time$("ms")-Ln   'grand total of all laps
        Rn=Tn*(lof-x)/x^2      'estimated time remaining in seconds
    end if
    Ln=time$("ms")             'start lap time (current time)
    

提交回复
热议问题