 <p>Inside of your NSView's .m. Obviously you might want to hook this up to a UI or something.</p> <pre><code>- (void)awakeFromNib { // Have to wait for the window to be onscreen, graphics context ready, etc [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerFired:) userInfo:NULL repeats:NO]; } - (void)timerFired:(NSTimer *)aTimer { [self lockFocus]; NSDate* then = [NSDate date]; int callIdx = 0; for( callIdx = 0; callIdx &lt; 1000; callIdx++ ) { [self drawRect:[self bounds]]; } NSDate* now = [NSDate date]; [self unlockFocus]; NSLog(@"Took %f seconds", [now timeIntervalSinceDate:then]); } - (void)drawRect:(NSRect)rect { [[NSColor redColor] set]; NSRectFill(rect); } </code></pre>