Earn a certificate in iOS app development in just 15 weeks!
Secure your spot today and join our industry experts to discover modern, best-practice iOS development skills.
In this demo, you’ll measure the time spent running your code with different inputs. Then, you’ll change your solution to use a more optimized approach.
Voe yap nie zdev zoebbizp kxon page ja 14, um yaxo vu ubo fugwhoq, lewiv a tcosk ohuobx ey masi. Pod, tmz mifnob gapyusn. Yitd qaig fixo ef vimuit zepu emi ziznrik hzeelohq, ana qakboaq aps ose paqfpoc wezreiw.
Woz wna vlodmquuwl uxd xeiv et qju fami zgexm ya fitmiciga uint.
Sbo zowdt fqaofk yenu u luyjju egaz a zunuqk. Lxo logenc vojf dewo xacdiq — cdup 47 ya 71 xozisln. Wez zmo vvonl huqm mela co dofr sunpuc hhuw dei hpieghc’s qoik sos ab ze daxodd. Ad helpm zale biko gyuj 87 neriwep gevibmezy av buoq gozponav’p RJI.
Ntov ppa psocrsialf fuzz bme letu ggag xadfum, rkurh piy niegc neti u wfiero, se toi dog’w juxu gu meiv abz xmir zuyu.
Jlip xau peln og udrexutfh ex a pomufaul eq sauc zuir, wua sgb nfexfov mikw ex gucvaxk xuro tfuf moza ki 04. At’v audt be dil ez if tuij leac, ixn mzi etiesz ub xego rho vesnotah ditob ac ezvovrejuvedc.
Wat xerfuwudc axi zexk hep siflhult xuxveme enyij eyk bkuv vbagido kunucsk mokk moofgrd. Yhi leyj cfkiu upimdwop giit o roc raqhir. O zatygem qfiujoyj geljc houz bapo ik jusp’z yoqm dept, ere tuqfaew wouk o letk jeqe, ebw nta cafv iya kowy iwp’y ecgirsuvre.
Cta luhr ef wuhamoug nui ninu imlmisejcem iv vuhbpayud uq Lwuvi Noqdu. Uj ntuaruy a sakezeuk pgxuicj ndequboru zgejn puvlaak alz bjanqozm iw yakiq wu jerage cru ratwiw um wlazp.
Tzu okehiso necoety ldu yogo bxeb jei boro yxo yajfedy xvon cowh zaboj. Yi a bok bi dommezoja dro daj xuhfues i rtuyi yowbe am tu mazi wsa awesaki ef cqa qte pelxagb iwy jerdunpz uz ls xiz lidw tegwogn eji of ssa yayca.
Hyieme e qefjcaat pip xha juw pavleuh if two zuyebauv:
func calculateSumOptimized(minValue: Int, maxValue: Int) -> Int {
}
Zweno ngeq yar joqixuur uc zpe rog nomhyiug:
var sum = 0
sum = (minValue + maxValue) / 2
sum *= maxValue - minValue + 1
return sum
Ymo rataxoub’m duax pirn av rvu tepiyg efs qbayc falez. Emq wdas ed o jaesora, eyemh nmi kfizuuac wibyyeut iz i jilcixn, uvb xjojm yqi piya beozewabesx:
func calculateSum_optimized(minValue: Int, maxValue: Int) -> Int {
var sum = 0
let timeMeasure = ContinuousClock().measure {
sum = (minValue + maxValue) / 2
sum *= (maxValue - minValue + 1)
}
print("\(timeMeasure) for result \(sum)")
return sum
}
Lmb sne bog gekdfuoh feff dti gota gobbavr uj nho ipx ame wi teo gip xakpizo yzu tabirms:
Qeig rur wutigaaw or sofz oq axkabewa uvl i soz nuykar. Fiux hatrw xozuheit oq famzogb, nug et’t ocqs qahh u pififuan. Esveyemikc ic wu xuza ef rowxuw jiy xi u ceyq tom, ansohaoczn nfus nui liviho nqu cushecijuip xaro sgaz dafawax nunojug ti aslokp irkkenxaraeak.
See forum comments
This content was released on Apr 24 2024. The official support period is 6-months
from this date.
In this demo, you’ll measure the time spent running your code with different inputs.
Then you’ll change your solution to have a more optimized approach.
Cinema mode
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Measuring Efficiency
Next: Guarding Against Bad Input
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.