ekjyot
ekjyot

Reputation: 2227

android: getting the time taken by the server to respond

I need to get the time taken by a server to respond when some request is send to the server in android. How shall i do this. CAn anyone help me over this.?

Thanks

Upvotes: 0

Views: 274

Answers (1)

since2006
since2006

Reputation: 226

//
long t1 = System.currentTimeMillis();

// some code here, eg: request remote server

long t2 = System.currentTimeMillis();
long elapse = t2 - t1;
//

Upvotes: 2

Related Questions