[comp.unix] time command

drich@klaatu.lanl.gov (David Rich) (02/23/90)

I've not run across a reasonable description of
the output of the time command in unix doc that
I've seen.  What do these numbers mean? In general,
what do they say about an application?

e.g., 46.6u 1.8s 0:50 96% 0+1716k 5+0io 13pf+0w

Dave (dor@lanl.gov)
--
David Rich
Military Systems Analysis Group (A-5)
MS F602
Los Alamos National Laboratory
Los Alamos, NM 87545

Phone: (505) 665-0726
Email: dor@lanl.gov

yahoo@unix.cis.pitt.edu (Kenneth L Moore) (04/13/90)

In article <3556@zorba.Tynan.COM> drich@klaatu.lanl.gov (David Rich) writes:
=>I've not run across a reasonable description of
=>the output of the time command in unix doc that
=>I've seen.  What do these numbers mean? In general,
=>what do they say about an application?
=>
=>e.g., 46.6u 1.8s 0:50 96% 0+1716k 5+0io 13pf+0w
=>
=>Dave (dor@lanl.gov)
=>--
=>David Rich
=>Military Systems Analysis Group (A-5)
=>MS F602
=>Los Alamos National Laboratory
=>Los Alamos, NM 87545
=>
=>Phone: (505) 665-0726
=>Email: dor@lanl.gov

Funny you should post this... Just today I tried to track down an
explaination. The man on time says see man csh and the csh man 
tells you nothing.

I would like to know the answer, too.


-- 
I don't yell and I don't tell and I'm grateful as hell: Benny Hill

leland@cs.columbia.edu (Lee Woodbury) (04/13/90)

In article <3556@zorba.Tynan.COM> drich@klaatu.lanl.gov (David Rich) writes:
>I've not run across a reasonable description of
>the output of the time command in unix doc that
>I've seen.  What do these numbers mean? In general,
>what do they say about an application?
>
>e.g., 46.6u 1.8s 0:50 96% 0+1716k 5+0io 13pf+0w

The 'time' command is part of the shell (in your case, the csh; the
sh's and ksh's time has a different output format).  The csh(1)
man page provides explication of the above format, but to summarize,
the above example indicates:

tag	   # unit	description
-----	---- ---------- --------------------------------------------
%U	46.6 seconds	CPU time devoted to the user's process.
%S	 1.8 seconds	CPU time consumed by the kernel on behalf of
			of the user's process.
%E	  50 seconds	Elapsed (wallclock) time for the command.
%P	  96 percent	( %U + %S ) / %E expressed as a percentage.
%X	   0 Kb		Average amount of shared memory used.
%D	1716 Kb		Average amount of unshared data space used.
%I	   5 -		Number of block input operations.
%O	   0 -		Number of block ouput operations.
%F	  13 - 		Number of page faults.
%W	   0 - 		Number of swaps.

Leland Woodbury
-- 
ARPANET/INTERNET: leland@cs.columbia.edu
	  USENET: ...!columbia!cs.columbia.edu!leland
	  BITNET: leland%cs.columbia.edu@cuvmb
	  USMAIL: Columbia Univ., 457 CS, 500 W. 120 St., NYC 10027-6699

guy@auspex.UUCP (Guy Harris) (07/04/90)

>>>I've not run across a reasonable description of
>>>the output of the time command in unix doc that
>>>I've seen.  What do these numbers mean? In general,
>>>what do they say about an application?
>>>
>>>e.g., 46.6u 1.8s 0:50 96% 0+1716k 5+0io 13pf+0w
>>
>>I would like to know the answer, too.
>
>The ``time'' shell builtin typically returns the contents of the tms
>structure.

Hrrumph.  The *Bourne* shell "time" shell builtin typically returns the
contents of the "tms" structure.  The *C* shell "time" builtin, which is
what his output looks like, selects various bits from the "struct
rusage" structure (what, you don't have such a structure on your system?
Not all UNIXes necessarily look exactly like yours...).

Here's a description from the SunOS 4.0.3 C shell manual page.  This
describes the format of the "time" shell variable, which controls the
output format of the "time" command:

     time              Control automatic timing of commands.  Can
                       be  supplied  with one or two values.  The
                       first is the reporting  threshold  in  CPU
                       seconds.  The  second  is a string of tags
                       and text  indicating  which  resources  to
                       report  on.   A  tag is a percent sign (%)
                       followed by  a  single  upper-case  letter
                       (unrecognized tags print as text):

                            %D   Average amount of unshared  data
                                 space used in Kilobytes.
                            %E   Elapsed (wallclock) time for the
                                 command.
                            %F   Page faults.
                            %I   Number  of  block  input  opera-
                                 tions.
                            %K   Average amount of unshared stack
                                 space used in Kilobytes.
                            %M   Maximum real memory used  during
                                 execution of the process.
                            %O   Number of  block  output  opera-
                                 tions.
                            %P   Total CPU time - U (user) plus S
                                 (system)  - as a percentage of E
                                 (elapsed) time.
                            %S   Number of seconds  of  CPU  time
                                 consumed by the kernel on behalf
                                 of the user's process.
                            %U   Number of seconds  of  CPU  time
                                 devoted to the user's process.
                            %W   Number of swaps.
                            %X   Average amount of shared  memory
                                 used in Kilobytes.

                       The default summary display  outputs  from
                       the %U, %S, %E, %P, %X, %D, %I, %O, %F and
                       %W tags, in that order.