This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Measure connection speed Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Measure connection speed" Watch "Measure connection speed" New topic
Author

Measure connection speed

Ahmad Ras
Greenhorn

Joined: Jun 09, 2010
Posts: 11
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

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Ahmad Ras
Greenhorn

Joined: Jun 09, 2010
Posts: 11
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Measure connection speed
 
Similar Threads
Collections.sort() : need guidance for my code
Puzzle anyone
internet speed boost
measure download speed of internet
Thread memory leak