to fetch response time

hey..i jus wrote a codo to ping a url but im havon difficulty in developing a code to fetch the response time taken to open that site..can u suggest me some method
[170 byte] By [ping@123a] at [2007-11-26 18:14:37]
# 1
Use System.currentTimeMillis.
DrLaszloJamfa at 2007-7-9 5:48:05 > top of Java-index,Java Essentials,Java Programming...
# 2
hey..thanks for the help..ill try this one
ping@123a at 2007-7-9 5:48:05 > top of Java-index,Java Essentials,Java Programming...
# 3

i tried with the method u suggested..it doesn get me the response time of the url

..is this the correct way ?

try{

System.setProperty("java.net.useSystemProxies","true");

System.getProperties().put("proxySet", "true");

System.getProperties().put("proxyHost", "");

System.getProperties().put("proxyPort", "");

long responseTime = System.currentTimeMillis();

int requestTime = 0;

if(responseTime >requestTime+5000){

System.out.println("The url is not accessible");

}

else

System.out.println("ping the url");

responseTime=requestTime;

URL yh = new URL("http://www.yahoo.com");

HttpURLConnection ut =(HttpURLConnection) yh.openConnection();

ut.setDoOutput(true);

in = new BufferedReader(new InputStreamReader(ut.getInputStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)

System.out.println(inputLine);

in.close();

}catch(Exception e){

e.printStackTrace();

}

}

}

ping@123a at 2007-7-9 5:48:05 > top of Java-index,Java Essentials,Java Programming...
# 4
System.currentTimeMillis() gives you the current time (in milliseconds).If you call it before and after an operation, the difference is the time in milliseconds that the operation took to complete.
DrLaszloJamfa at 2007-7-9 5:48:05 > top of Java-index,Java Essentials,Java Programming...
# 5

i jus have doubt..im getting te time interval before and after pinging now..thanks to u but is it the same as the time taken to load the page on the browser.

isn t pinging jus aceesssing the url .....so is it correct to use the interval between the pinging response as the rsponse time to load a url...hope im not confusing..i am jus not sure of how exactly this concept works with pinging..

ping@123a at 2007-7-9 5:48:05 > top of Java-index,Java Essentials,Java Programming...