I am making a call to REST URL and trying to measure how much time it is taking to get the response back.
I am using DefaultHttpClient for that to get t
Assuming you are using the vanilla DefaultHttpClient (which uses BasicClientConnectionManager internally), you first need to consume the outstanding/last response.
EntityUtils.consumeQuietly(httpResponse.getEntity());
Else, you can reallocate DefaultHttpClient each time.
Source: Workaround to not shutdown DefaultHttpClient() each time after usage