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.
$ time /Applications/TextEdit.app/Contents/MacOS/TextEdit
real ...
Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.