And if you enabled vsync (which is by default), your code will never draw faster than the refresh rate (usually 60 Hz). That's probably why you never use more than 15 % of the CPU.

Le 15 août 2009 à 06:05, Roland King a écrit :

1) again I think you'll get better answers on the OpenGL list than the cocoa dev list - the guys on that list eat and breathe openGL and I've had some fantastic help there.

2) Are you targetting OSX 10.3 for your code? That tech tip says use an NSTimer only for 10.3 compatibility and CVDisplayLink for anything from 10.4 onwards. If you do have to use a timer have you read the caveat about enabling vertical synchronization (however one does that) or "the application will burn a lot of CPU time just firing off the timer, even though the drawing loop hasn't even completed its last run."?


On Aug 15, 2009, at 11:21 AM, Shayne Wissler wrote:

Hello,

Following the advice at
http://developer.apple.com/qa/qa2004/qa1385.html, I attempted using a
timer running at 1000Hz. However, on my iMac, this causes about a ~15%
CPU hit. When I run Shark, it says it's spending a good deal of time
in objc_msgSend, presumably in the call "[self setNeedsDisplay:YES]".

Is all this normal/expected?


Shayne Wissler
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org

This email sent to r...@rols.org

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org

This email sent to devli...@shadowlab.org


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to