Search code examples
network-programmingdownloadbandwidth

Calculating download/upload speed


If one calculates download/upload speed, what is more realistic?

If the total data received/sent is divided by the total transfer time or if the chunk size received/sent is divided by the time since the last transfer(the current time between receiving)?

The second option is more up to date but I am not sure if it is a stable value.

Which one is used in applications?


Solution

  • Neither. The best approach is a moving average of the last N chunks.