On Jun 12, 2005, at 3:12 PM, Sanri Parov wrote: On Sun, 12 Jun 2005 11:14:42 -0700, mmalcolm crawford wrote:
Use an NSTimer instead:
Ok. But that's not the point. When it comes to fire the timer, the whole interface freezes. That's why I used a different thread.
How often to do plan to fire the timer? In one of my applications, I fire a timer every 30th of a second, and I do not notice a substantial interface freeze.
One important consideration: From my experience I have noticed that when fired at rapid rates, the NSTimers do not always go at the exact interval they are told to go at.
For example, in a movie program I wrote, I fired the NSTimer 30 times per second. The method the NSTimer called, however, performed complex movie functions. As a result, what was supposed to be 30 times/sec became something like 5.
As a result, you will probably want to store the time the stopwatch started at as an instance variable and see how much time has passed each time the NSTimer has been fired.
BTW: I'm sorry about my previous incorrect posts. I'll be sure to check over my posts before submitting them in the future.
-Eric |