1

I am trying to implement a Speed Test on my application. To do so I was thinking of doing the following.

For the download speed, I am going to download a file from my server and time it until completion and the download speed would be the (size of file)/(amount of time to download).

For the upload speed, I am going to upload a file to my server and time it until completion and the upload speed would be (size of file)/(amount of time to upload).

Am I going the correct way about it? Also how would I calculate the Ping or Latency?

moe_nyc
  • 307
  • 1
  • 4
  • 18

1 Answers1

2

As far as I know, your method to calculate the download and the upload speeds is correct and speedtest.net is also doing this. To calculate ping, you might want to have a look at the source code which is written in C: http://ws.edu.isoc.org/materials/src/ping.c

Alperen Görmez
  • 392
  • 1
  • 3
  • 14