Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dantastic

macrumors 6502a
Original poster
Jan 21, 2011
572
678
I want to add a label hooked up to a timer. I want the label to spew out seconds & milliseconds (ss:mm)

The most obvious way to do this seems to be the use of NSTimer, but I'd have to fire every 0.01 sec to update the label. Is that OK or an awful overhead?

Is there a better function out there to do this or am I doing it right? (or do I need to be told? :eek:)
 
From the documentation:

Because of the various input sources a typical run loop manages, the effective resolution of the time interval for a timer is limited to on the order of 50-100 milliseconds. If a timer’s firing time occurs during a long callout or while the run loop is in a mode that is not monitoring the timer, the timer does not fire until the next time the run loop checks the timer. Therefore, the actual time at which the timer fires potentially can be a significant period of time after the scheduled firing time.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.