Let\'s say you want to calculate the remaining download time, and you have all the information needed, that is: File size, dl\'ed size, size left, time elapsed, momentary dl
I think it's just an averaging algorithm. It averages the rate over a few seconds.