'\" te .\" Copyright (c) 1992, 2011, Oracle and/or its affiliates. All rights reserved. .\" Copyright 1989 AT&T .TH timex 1 "15 Aug 2011" "SunOS 5.11" "User Commands" .SH NAME timex \- time a command; report process data and system activity .SH SYNOPSIS .LP .nf \fBtimex\fR [\fB-o\fR] [\fB-p\fR [\fB-fhkmrt\fR]] [\fB-s\fR] \fIcommand\fR .fi .SH DESCRIPTION .sp .LP The given \fBcommand\fR is executed; the elapsed time, user time and system time spent in execution are reported in seconds. Optionally, process accounting data for the \fBcommand\fR and all its children can be listed or summarized, and total system activity during the execution interval can be reported. .sp .LP The output of \fBtimex\fR is written on standard error. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-o\fR\fR .ad .RS 6n .rt Report the total number of blocks read or written and total characters transferred by \fBcommand\fR and all its children. This option works only if the process accounting software is installed. .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .RS 6n .rt List process accounting records for \fBcommand\fR and all its children. This option works only if the process accounting software is installed. Suboptions \fBf\fR, \fBh\fR, \fBk\fR, \fBm\fR, \fBr\fR, and \fBt\fR modify the data items reported. The options are as follows: .sp .ne 2 .mk .na \fB\fB-f\fR\fR .ad .RS 6n .rt Print the \fBfork\fR(2)/ \fBexec\fR(2) flag and system exit status columns in the output. .RE .sp .ne 2 .mk .na \fB\fB-h\fR\fR .ad .RS 6n .rt 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). .RE .sp .ne 2 .mk .na \fB\fB-k\fR\fR .ad .RS 6n .rt Instead of memory size, show total kcore-minutes. .RE .sp .ne 2 .mk .na \fB\fB-m\fR\fR .ad .RS 6n .rt Show mean core size (the default). .RE .sp .ne 2 .mk .na \fB\fB-r\fR\fR .ad .RS 6n .rt Show CPU factor (user time/(system-time + user-time)). .RE .sp .ne 2 .mk .na \fB\fB-t\fR\fR .ad .RS 6n .rt Show separate system and user CPU times. The number of blocks read or written and the number of characters transferred are always reported. .RE .RE .sp .ne 2 .mk .na \fB\fB-s\fR\fR .ad .RS 6n .rt Report total system activity (not just that due to \fBcommand\fR) that occurred during the execution interval of \fBcommand\fR. All the data items listed in \fBsar\fR(1) are reported. .RE .SH EXAMPLES .LP \fBExample 1 \fRExamples of \fBtimex\fR. .sp .LP A simple example: .sp .in +2 .nf \fBexample% timex \fR\fB-ops\fR\fB sleep 60\fR .fi .in -2 .sp .sp .LP A terminal session of arbitrary complexity can be measured by timing a sub-shell: .sp .in +2 .nf \fBexample% timex \fR\fB-opskmt\fR\fB sh\fR \fIsession commands\fR \fBEOT\fR .fi .in -2 .sp .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/accounting/legacy-accounting .TE .SH SEE ALSO .sp .LP \fBsar\fR(1), \fBtime\fR(1), \fBexec\fR(2), \fBfork\fR(2), \fBtimes\fR(2), \fBattributes\fR(5) .SH NOTES .sp .LP Process records associated with \fBcommand\fR are selected from the accounting file \fB/var/adm/pacct\fR 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.