Next | Making Programs Faster | 24 |
Most Unix systems come with a command called time
For quick estimates of entire programs, the time command is handy
% time ls #BIGMESS# PENN YAPC_16.jpg gym photos ... real 0m0.858s user 0m0.130s sys 0m0.230s
Often this is built into the shell; the time program is different:
% /usr/bin/time ls #BIGMESS# PENN YAPC_16.jpg gym photos ... 0.13user 0.23system 0:00.86elapsed 41%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (130major+24minor)pagefaults 0swaps
41%CPU here is the CPU utilization
It's just CPU time divided by wallclock time
Most of the other information is provided by the getrusage system call
Not all systems provide all the possible information
Hence the 0outputs result on my system
Next | Copyright © 2003 M. J. Dominus |