If given a mapping of file sizes to their respective transfer times, how can I approximate the constant factor that each file will have as overhead?
E.g.
File size Transfer time -------------------------------- 1 kB 2 ms 1000 kB 1001 ms --------------------------------
From this table I can see that each file has an overhead of 1 ms and each kB takes another ms. But how do I do this mathematically?
I need to calculate this in C++ as a moving average for an estimation of remaining copy time and would be grateful for some ideas (just math or pseudocode is ok.)