Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Measure connection speed  RSS feed

 
Ahmad Ras
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
How can you measure my internet connection speed in Java? I am thinking about calling the DOS command ping to yahoo website for example and see how log the packets take. Is there another way programmatically or by calling external process/api?
Thank you very much

PS: My app is to run on windows clients
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ping is unrelated to connection speed. Most speed measurements are done by dowloading a large (10MB or more) file, download that, and then calculate the speed based on how large the file is and how long it took to download. Similarly you can calculate the upload speed by uploading a file.

Of course the source / destination of the file matters a lot. If that's a slow server you think your speed is slow but in fact it may not be. Several ISPs have servers you can use for this, with files available you can download for just these purposes.
 
Ahmad Ras
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh Great. Thanks I didnt know tht ping would be irrilevent. can you tell me why? I thought it measures how long the packet will take to make to a server. Wouldnt be a good method to compare (lets say 5 different connections) since it is going the same target.

If I am look for ISP service like that ( where ican dowload/upload) what key word should Iuse to search for that? I have no clue where to start
thanks man
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!