objective c - Calculate time taken to load a window once all async service call is done -
how calculate time taken load view/window? can done this:
nsdate *starttime=[nsdate date]; //some code load window wincontroller nsdate *endtime=[nsdate date]; nstimeinterval diff = [endtime timeintervalsincedate:starttime]; nslog(@"time load %f seconds.\n\n\n",diff);
but not calculate total , exact time taken. load window, , in init , awakefromnib asynchronously calls services, loads custom views, populates tableviews etc, , spread on dozens of classes/controllers , scores of methods.
if use above(program shown), endtime
reached while spinner continues spin , service calls in progress.
i can check watching clock takes more minute load window, , ready perform action on it, diff
calculates 0.5 seconds something.
now problem can not change whole code of project, can insert few things in between.
how this, suggestions appreciated.
i know late , not sure if still searching answer or no(but might other people searching solution similar problems).but in such cases have keep track of code i.e. need know callback async calls called in last. easy enough trace. common , simple, place nslog(%@"1")... nslog(%@"any_number") in callbacks. , check gets printed last. way can place endtimer code in callback , know how time takes load window. hope helps someone.
Comments
Post a Comment