I am in the process of optimizing an iPhone app for very short load time and am wondering:
Is there a means of measuring the load time of an iPhone app from the time the user taps the icon to the time that the app is usable (or at least –viewDidLoad gets called)?
Ideally this would work in the device and simulator, but if someone has found a way to measure this time exclusively in the simulator that would at least be a starting point.
And no; "stopwatch" or "one Mississippi, two Mississippi" do not count. :-)
Start a timer in the init method of the App Delegate, and then stop when the viewDidAppear:-
Start timer with:-
NSDate *startTime = [NSDate date];
...and end with:-
NSTimeInterval elapsedTime = [startTime timeIntervalSinceNow];
NSLog(@"Startup tasks: %f", -elapsedTime);
This won't start from the moment the icon is tapped, but should be fairly early into your workings. You could probably view an earlier time in the logs put out in the debugger console?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With