O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Command-Line Tools

Mac OS X comes with a number of command-line tools for tracking down particular types of performance problems. The nice thing about the command line is that you can remotely log into a machine and watch things as they happen. They also don’t interfere with your application’s user interface.

time

The simplest tool is time. It times command execution and shows you clock time, CPU time in userspace, and CPU time spent in the kernel. Here is a run of /usr/bin/time on TextEdit. The time measured was the time starting TextEdit up, loading /usr/share/dict/words, and then scrolling from the top to the bottom.

$​ ​t​i​m​e​ ​/​A​p​p​l​i​c​a​t​i​o​n​s​/​T​e​x​t​E​d​i​t​.​a​p​p​/​C​o​n​t​e​n​t​s​/​M​a​c​O​S​/​T​e​x​t​E​d​i​t​ r​e​a​l​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required