Results 1 to 5 of 5
  1. #1
    rajeshgubba is offline Member
    Join Date
    Apr 2008
    Posts
    7
    Rep Power
    0

    Default How to calculate/get the downloading speed of the internet??

    Hi,
    can anybody plz tell me how can i get the downloading speed of internet.
    i am trying to download one file from internet using the java code.

    we can easily calculate the downloading speed if we know the file size and internet speed per sec.

    How can we get the internet speeed?

    help me

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,457
    Rep Power
    25

    Default

    What is the internet speed? If it takes n seconds to download y bytes then the download speed would be y/n bytes/sec
    Use System.currentTimeMillis() for the time and accumulate the bytes read by saving the return value from read() method

  3. #3
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Quote Originally Posted by rajeshgubba View Post
    How can we get the internet speeed?
    Why do you want it? What do you expect it will tell you?

    What it can tell you is the speed at that instant. If you try later, you are most likely to get different speeds.

    What can you do if you don't like the number you calculate?

  4. #4
    J-Live is offline Member
    Join Date
    Oct 2008
    Posts
    24
    Rep Power
    0

    Default

    Is there a way to limit the download speed so the connection doesn't use all the bandwidth, if I'm using a HttpUrlConnection?

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,457
    Rep Power
    25

Similar Threads

  1. Replies: 3
    Last Post: 09-16-2008, 11:55 AM
  2. Downloading An Image
    By a_klasanov in forum New To Java
    Replies: 3
    Last Post: 07-31-2008, 10:34 AM
  3. [SOLVED] Downloading jconn3.jar
    By DonCash in forum JDBC
    Replies: 1
    Last Post: 04-15-2008, 05:02 PM
  4. Problems with downloading Files from Applet
    By Albert in forum Java Applets
    Replies: 1
    Last Post: 07-05-2007, 05:09 AM
  5. compare speed
    By bbq in forum JDBC
    Replies: 1
    Last Post: 06-28-2007, 05:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •