Re: Stopwatch
Re: Stopwatch
- Subject: Re: Stopwatch
- From: Joshua Orr <email@hidden>
- Date: Sun, 12 Jun 2005 13:41:52 -0600
>
> 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:
>>>
>>>
>> <http://developer.apple.com/documentation/Cocoa/Conceptual/Timers/index.html>
>>
>> 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.
Were you using the main thread to do the calculations? NSTimers rely on
NSRunLoop, and if you where not letting your program get back down the run
loop during the complex calculations, then that¹s probably the problem.
If you do your calculations in a different thread, you may see better
results.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden