Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!hao!seismo!harvard!wjh12!foxvax1!brunix!ddj From: ddj@brunix.UUCP (Dave Johnson) Newsgroups: net.unix-wizards Subject: Re: What does csh 'time' tell the user Message-ID: <11061@brunix.UUCP> Date: Fri, 7-Dec-84 18:35:53 EST Article-I.D.: brunix.11061 Posted: Fri Dec 7 18:35:53 1984 Date-Received: Mon, 10-Dec-84 02:51:18 EST References: hammer.1034 Lines: 39 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@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);