TIME - give CPU and real times for a command.

Syntax:

time [time options] ["commands"]
       or
time string
(+|-)Stop (+)           (+|-)Verbose (+)
Iteration=number (1)

Examples:

time
time >.time "expl b command"
time i=20 -stop -v >temp "beep" 'wmi'

Options:

"commands"
are one or more command lines for TSS commands. Each command must be surrounded by single or double quotes.
Iteration=number
executes the given command "number" times. The default is to execute the command once. The statistics obtained are averaged over the "number" times.
-Stop
tells TIME not to stop if errors occur during an iteration of the command line. Normally TIME stops if the command being executed returns an error status.
+Verbose
displays several lines of statistics.
-Verbose
only displays a single line of information.
string
can be the name of a time zone locale, or a date/time string (see below for more details).

Description:

If given no arguments and no command line, TIME merely prints the date and time. Otherwise, TIME executes the given command(s). Upon completion, TIME displays the elapsed real time, elapsed processor time, the number of characters (approximately) of keyboard I/O, and the number of file I/O calls generated. The +Verbose format (default) looks like this.

(Averaged over 2 iterations)
Start 08/07/81 at 14:26:03.266
End   08/07/81 at 14:26:05.003
Elapsed Time       0:00:01.736
Processor Time     0:00:00.077
Key I/O = 24, File I/O = 2

If you specify -Verbose, the output takes the form

Elapsed 0:00:01.928, Proc 0:00:00.078, Key I/O 9, File I/O 2

The Iteration=number option lets you execute a command any number of times. The statistics generated reflect the total time taken by all the iterations.

Time Conversions:

The form of the command

time string

is used for time conversions.

If the string is the name of a time zone locale, TIME displays the current time in that locale. For example,

time gmt

displays the current time in terms of the Greenwich Mean Time time zone.

If the string represents a date/time, TIME displays that date and time in the current time zone locale. For example,

time 3 days

displays the date and time three days from now.

time 12:14 gmt

converts 12:14 Greenwich Mean Time to the equivalent local time and displays the result. The date/time string may have any form recognized by the B lib .TOSEC function; see "expl b lib .tosec" for details.

Notes:

TIME calculates the processor time using the DRL TIME system call. Since this system call is none too accurate, the time reported should be taken with a grain of salt.

The terminal I/O count is only approximate because TSS keeps the number of characters divided by eight.

TIME also accepts a command line of the form

TIME [time options] : command

as in

time i=3 : beep

See Also:

expl b tz
for information about time zone locales.

Copyright © 1996, Thinkage Ltd.