time man page on SmartOS

Man page or keyword search:  
man Server   16655 pages
apropos Keyword Search (all sections)
Output format
SmartOS logo
[printable version]

TIME(1)								       TIME(1)

       time - time a simple command

       time [-p] utility [argument]...

       The  time  utility  invokes utility operand with argument, and writes a
       message to standard error that lists timing statistics for utility. The
       message includes the following information:

	   o	  The  elapsed	(real)	time between invocation of utility and
		  its termination.

	   o	  The User CPU time, equivalent to the sum  of	the  tms_utime
		  and  tms_cutime fields returned by the times(2) function for
		  the process in which utility is executed.

	   o	  The System CPU time, equivalent to the sum of the  tms_stime
		  and  tms_cstime  fields returned by the times() function for
		  the process in which utility is executed.

       When time is used as part of a pipeline, the times reported are unspec‐
       ified,  except when it is the sole command within a grouping command in
       that pipeline. For example, the commands on the left  are  unspecified;
       those on the right report on utilities a and c, respectively:

	 time a | b | c	     { time a } | b | c
	 a | b | time c	     a | b | (time c)

       The following option is supported:

	      Writes the timing output to standard error in the following for‐

		real %f\nuser %f\nsys %f\n < real seconds>, <user seconds>,
		<system seconds>

       The following operands are supported:

		    The name of the utility that is to be invoked.

		    Any string to be supplied as  an  argument	when  invoking

       The  time  utility  returns  exit status 127 if an error occurs so that
       applications can distinguish "failure to find a utility" from  "invoked
       utility	exited	with  an  error	 indication." The value 127 was chosen
       because it is not commonly used for other meanings. Most utilities  use
       small values for "normal error conditions" and the values above 128 can
       be confused with termination due to receipt of a signal. The value  126
       was  chosen  in	a similar manner to indicate that the utility could be
       found, but not invoked.

       Example 1 Using the time command

       It is frequently desirable to apply time to pipelines or lists of  com‐
       mands.  This  can  be  done by placing pipelines and command lists in a
       single file. This single file can then be invoked as a utility, and the
       time applies to everything in the file.

       Alternatively,  the  following  command	can be used to apply time to a
       complex command:

	 example% time sh -c 'complex-command-line'

       Example 2 Using time in the csh shell

       The following two examples show the differences between the csh version
       of  time	 and  the version in /usr/bin/time. These examples assume that
       csh is the shell in use.

	 example% time find / -name csh.1 -print
	 95.0u 692.0s 1:17:52 16% 0+0k 0+0io 0pf+0w

       See csh(1) for an explanation of the format of time output.

	 example% /usr/bin/time find / -name csh.1 -print
	 real  1:23:31.5
	 user	  1:33.2
	 sys	 11:28.2

       See environ(5) for descriptions of the following environment  variables
       that affect the execution of time: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,

       If utility is invoked, the exit status of time will be the exit	status
       of  utility. Otherwise, the time utility will exit with one of the fol‐
       lowing values:

		    An error occurred in the time utility.

		    utility was found but could not be invoked.

		    utility could not be found.

       See attributes(5) for descriptions of the following attributes:

       │Interface Stability │ Standard	      │

       csh(1), shell_builtins(1),  timex(1),  times(2),	 attributes(5),	 envi‐
       ron(5), standards(5)

       When  the time command is run on a multiprocessor machine, the total of
       the values printed for user and sys can exceed real. This is because on
       a  multiprocessor machine it is possible to divide the task between the
       various processors.

       When the command being timed is interrupted,  the  timing  values  dis‐
       played may not always be accurate.

       Elapsed	time  is  accurate to the second, while the CPU times are mea‐
       sured to the 100th second. Thus the sum of the CPU times can be up to a
       second larger than the elapsed time.

				  Feb 1, 1995			       TIME(1)

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net