iphone - Stopwatch - NSTimer or NSDate -
i want implement timer counts every second. have 2 ways in mind, kinda confused 1 optimal way it. it's either using nstimer or nsdate, , understand nstimer used fire methods, maybe shouldn't use nstimer nsdate?
some clarification appreciated, thanks.
nsdate
model class. doesn't fire or except represent date , time. have use both (nstimer
, nsdate
) stopwatch. when start watch save current date in nsdate
instance , start nstimer 1 sec interval (or more if want display milliseconds). , everytime timer fires, calculate difference between current date , saved date , show user.
Comments
Post a Comment