2012-03-01 26 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