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();
}
}
}
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..