2012-03-01 22 views

回答

1

我认为这将有助于你:与不同的网络连接上执行此:

//start a timer here 
URL url = new URL("http://www.android.com/"); 
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); 
try 
{ 
    InputStream in = new BufferedInputStream(urlConnection.getInputStream()); 
    readStream(in); 
    //End timer after read stream. Log the time difference. 
    finally 
    { 
    urlConnection.disconnect(); 
    } 
} 
+0

这也是迄今为止我能想到的唯一方法。谢谢 – 2012-03-01 04:01:05