timex(1) timex(1)
NAME
timex - time a command; report process data and system activity (time
execution)
SYNOPSIS
timex [option ...] cmd [arg ...]
DESCRIPTION
timex has a program or shell script executed and reports the time
spent in execution. As with time(1), the measured CPU times are output
to standard error in the format hh:mm:ss.zz, where hh are hours, mm
are minutes, ss are seconds and zz are hundredths of seconds.
timex reports values for real, user, and sys.
- real is the elapsed time during the invoked process and its child
processes, i.e. the time between program call and program termina-
tion.
- user is the time spent by the process or one of its child processes
when executing user code. A process executes user code when it exe-
cutes machine instructions from its own code segment.
- sys is the time spent by the process or one of its child processes
when executing system code. A process executes system code when it
executes machine instructions from system calls.
Examples of timex output:
real 0.04
user 0.01
sys 0.02
For longer runtimes:
real 22:26.30
user 6:08:53.68
sys 6:47.91
You can use options to obtain additional process data on the executed
command and its child processes, as well as data on total system
activity during command runtime.
Note:
If timex is called on a multiprocessor system, the sum of user
and system time will be considerably greater than real time. A
figure of more than 100% for the apparent CPU load is the result
of child processes being split between a number of processors.
Page 1 Reliant UNIX 5.44 Printed 11/98
timex(1) timex(1)
OPTIONS
No option specified:
timex executes the given command cmd and reports the real, user
and system time spent in execution of the command.
-p (process) timex lists process data on cmd and its child
processes. This option only works if process accounting has been
activated.
Options f, h, k, m, r and t are suboptions of -p and are only
effective when used in conjunction with -p.
-o timex reports the total number of blocks read or written by cmd
and its child processes. The number of characters transferred is
also reported.
This option only works if process accounting has been activated.
-s timex reports total system activity occurring during the runtime
of cmd. The report covers the same activities as the sar com-
mand.
The following options are only effective when used in conjunction with
-p:
-f The output contains additional columns for the fork and exec
flags, and for the system exit status.
-h (hog factor) Instead of mean memory size for the process, timex
reports the fraction of total available CPU time consumed by the
process during its execution. This value is known as the "hog
factor" and is calculated as: total CPU time divided by elapsed
time.
-k timex reports the cumulative memory usage per minute of process
execution.
-m (mean core size) timex reports the mean core size.
This option is set by default.
-r timex reports the CPU factor (user-time/(system-time + user-time)).
-t timex reports system CPU time separately from user CPU time. The
number of blocks read or written and the number of characters
transferred are always reported.
cmd Program or shell script executed by timex.
arg Argument for the program or shell script cmd. The number of
arguments required depends on the cmd involved.
Page 2 Reliant UNIX 5.44 Printed 11/98
timex(1) timex(1)
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
EXAMPLES
The time required to execute a find command is to be measured and
reported. To do this, you enter timex followed by the full syntax of
the find command with all the necessary arguments:
$ timex find . -name test -print
real 2.32
user 0.10
sys 1.65
SEE ALSO
sar(1), time(1), times(2).
Page 3 Reliant UNIX 5.44 Printed 11/98