To Index

 See the UNIX Programmers Manual or via % man csh 


 % time cp /etc/rc /usr/bill/rc
  will display:

       0.0u 0.1s 0:01 8% 2+1k 3+2io 1pf+0w
 
  and indicates that the 'cp' command used a negligible amount of user time (u),
  about 1/10th of a system time (s); the elapsed time was 1 second (0:01),
  there was an average memory usage of 2k bytes of program space and 1k
  bytes of data space over the cpu time involved (2+1k);
  the program did three disk reads and two disk writes (3+2io),
  and took one page fault and was not swapped (1pf+0w).


 % time wc /etc/rc /usr/bill/rc
  will display:

	52	178	1347 /etc/rc
	52	178	1347 /usr/bill/rc
	104	356	2694 total
	0.1u 0.1s 0:00 13% 3+3k 5+3io 7pf+0w
 
  indicates that 'wc' used 0.1 seconds of user time and 0.1 seconds of
  system time in less than a second of elapsed time. The percentage `13%'
  indicates that over the period when it was active the command `wc' used an
  average of 13 percent of the available CPU cycles of the machine.


  > From Mark Wittenberg ({zehntel,varian}!rtech!mark):
 This was written for 4.1bsd csh; I don't know if it much has changed for
 4.2bsd.
    The output format is selectable by the user (this feature is undocumented 
  by UCB, and so may not be supported later).
    If the 'time' shell variable has two components then the second component 
  is taken to be an output specification string reminiscent of printf (III).
    A percent sign introduces a conversion operator; the next character 
  specifies the desired conversion.  Other characters are simply printed.
  The conversion characters and their meanings are:


  U	User time in seconds.
  S	System time in seconds.
  E	Elapsed time in seconds.
  P	Percentage of the CPU.
  X	Average kilobytes of resident text pages.
  D	Average kilobytes of resident data+stack pages.
  K	Average kilobytes of resident text+data+stack pages.
  M	Maximum kilobytes of resident text+data+stack pages.
  I	The number of filesystem input events (reads that came from the disk).
  O	The number of filesystem output events (writes that went to the disk).
  F	The number of page faults which resulted in disk activity.
  R	The number of page faults resulting from the simulation of reference bits.
  W	The number of swaps which occurred.


  The default format is:

 "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww"
 
  but if you want more information and more mnemonic identifiers, you might
  want to try:

 "%Uu %s %E %P (%Xt+%Dds+%Kavg+%Mmax)k %Ii+%Oo (%Fmaj+%Rmin)pf %Wswaps"
 
   BUGS: Elapsed time is accurate to the second, while the CPU times are 
  measured to the 60th second.  Thus the sum of the CPU times can be up 
  to a second larger than the elapsed time.
 
 Example of usage:

 % time
 % 0.5u 0.6s 0:06 16% 128+44k 21+9io 0pf+0w
 % cat changetime
 #
 set x=\
 "%Uu %s %E %P (%Xt+%Dds+%Kavg+%Mmax)k %Ii+%Oo (%Fmaj+%Rmin)pf %Wswaps"
 set time=(60 "$x")
 % source changetime
 % time
 0.7u  0:27 6% (118t+45ds+164avg+98max)k 27i+12o (1maj+7min)pf 0swaps
 %
 

To Index