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.)
As you said, there are two variables:
Tis the Time to access one file;Ais the Access time per kilobyte (kB).So, for the two files:
2ms = T + 1A1001ms = T + 1000ASubtract 1) from 2):
Substitute for
Ain 1):Simple simultaneous equations!