Skip navigation.
 
mlRe: Giving the CPU a break...
FROM : Buzz Andersen
DATE : Mon Nov 18 23:09:51 2002

> My question is: is there a good way for me to give the CPU a break and
> make the computer more responsive during this loop without
> compromising performance significantly?


A follow-up: I've experimented a bit with using the thread sleep
approach, and it seems to work reasonably well.  According to top, my
processor utilization never really gets above 40%.  I simply put the
following code at the bottom of my loop:

[NSThread sleepUntilDate: [[NSDate date] addTimeInterval: .01]];

Not a big deal--I just wanted to post that for generations of future
cocoa.mamasam.com searchers who might have the same question :-).

I would still be interested to know about alternative approaches if
anyone has any better ideas...

--
Buzz Andersen
email: <email_removed>
web: http://www.scifihifi.com
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlGiving the CPU a break... Buzz Andersen Nov 18, 20:04
mlRe: Giving the CPU a break... Buzz Andersen Nov 18, 23:09
mlRe: Giving the CPU a break... Kevin Elliott Nov 19, 18:33
mlRe: Giving the CPU a break... Alex Rice Nov 20, 02:05
mlRe: Giving the CPU a break... Sherm Pendley Nov 20, 05:00
mlRe: Giving the CPU a break... Ryan Stevens Nov 20, 16:57
mlRe: Giving the CPU a break... Buzz Andersen Nov 21, 05:32
mlRe: Giving the CPU a break... Ondra Cada Nov 21, 15:02