What does csh 'time' tell the user

Dave Johnson ddj at brunix.UUCP
Sat Dec 8 09:35:53 AEST 1984


The time command in csh prints out User time, System time, Elapsed time,
Percentage of machine to elapsed time, Text+Data size, Input/Output blocks,
page Faults, and sWaps.  Time is controlled by the csh variable "time"; if
it is one word this specifies the threshold where time is printed
automagically after each command, and if there are two words, the second is
the "printf" style format used to select what to print.  The default can be
reproduced by the following command

	set time=(n "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww")

A summary of the available formats follows (along with the code used to
print each field).

	Dave Johnson
	ddj at brown.csnet
	{ihnp4,decvax,allegra}!brunix!ddj

----------
Formats available for csh "time" variable output

   Value	%x	source code
   -----	--	-----------
user time	'U': p60ths(v1->vm_utime - v0->vm_utime);
system time	'S': p60ths(v1->vm_stime - v0->vm_stime);
elapsed time	'E': psecs(sec);
percentage	'P': printf("%d%%", (int) ((100 * t) / (60 * (sec ? sec : 1))));
number of swaps	'W': i = v1->vm_nswap - v0->vm_nswap;
text rss	'X': printf("%d", t == 0 ? 0 :
			(v1->vm_ixrss-v0->vm_ixrss)/(2*t));
data srss	'D': printf("%d", t == 0 ? 0 :
			(v1->vm_idsrss-v0->vm_idsrss)/(2*t));
total rss	'K': printf("%d", t == 0 ? 0 :
			((v1->vm_ixrss+v1->vm_idsrss) -
			 (v0->vm_ixrss+v0->vm_idsrss))/(2*t));
max rss		'M': printf("%d", v1->vm_maxrss/2);
major faults	'F': printf("%d", v1->vm_majflt-v0->vm_majflt);
minor faults	'R': printf("%d", v1->vm_minflt-v0->vm_minflt);
blocks read	'I': printf("%d", v1->vm_inblk-v0->vm_inblk);
blocks written	'O': printf("%d", v1->vm_oublk-v0->vm_oublk);



More information about the Comp.unix.wizards mailing list