Take the 2-minute tour ×

I want to measure the time taken to get response from a service call, do we have any tools to calculate or any classes in iphone sdk to calculate the response time

Thanks, Prasad

share|improve this question
add comment

2 Answers

You can simply use NSDate:

NSDate *start=[NSDate date];
NSLog(@"Start time %@", start);

[request startSynchronous];

and in the success/fail selector, call:

NSDate *end=[NSDate date];
NSLog(@"End time %@", end);

double ellapsedSeconds= [end timeIntervalSinceDate:start];
share|improve this answer
add comment

use this

 startDate = [NSDate date];

here you call the webservice

NSTimeInterval startTime = [startDate timeIntervalSinceNow];

this will give you the time interval.

share|improve this answer
add comment

Your Answer


