timex - time a command; report process data and system activity
timex [-o] [-p [-fhkmrt]] [-s] command
The given command is executed; the elapsed time, user time
and system time spent in execution are reported in seconds. Optionally,
process accounting data for the command and all its children can be
listed or summarized, and total system activity during the execution
interval can be reported.
The output of timex is written on standard error.
The following options are supported:
Report the total number of blocks read or written and
total characters transferred by command and all its children. This
option works only if the process accounting software is installed.
List process accounting records for command
all its children. This option works only if the process accounting software is
installed. Suboptions f
modify the data items reported. The options are as follows:
Print the fork(2)
flag and system
exit status columns in the output.
Instead of mean memory size, show the fraction of total
available CPU time consumed by the process during its execution. This ``hog
factor'' is computed as (total CPU time)/(elapsed time).
Instead of memory size, show total kcore-minutes.
Show mean core size (the default).
Show CPU factor (user time/(system-time +
Show separate system and user CPU times. The number of
blocks read or written and the number of characters transferred are always
Example 1 Examples of timex.
Report total system activity (not just that due to
) that occurred during the execution interval of command
All the data items listed in sar(1)
A simple example:
example% timex -ops sleep 60
A terminal session of arbitrary complexity can be measured by
timing a sub-shell:
example% timex -opskmt sh
Process records associated with command are selected from
the accounting file /var/adm/pacct by inference, since process
genealogy is not available. Background processes having the same user ID,
terminal ID, and execution time window will be spuriously included.