Previous Topic: CP()Next Topic: D2P()


CPUTIME()

This function enables an IMOD task to determine how much CPU time it has consumed.

Syntax

{value|string|number} = CPUTIME({STCK|FULL[B]|SEC})

Parameters

value

Unsigned 64-bit binary value in IBM TOD clock format.

string

12-character value, in the format hh:mm:ss.tho.

number

Numeric value suitable for REXX computational use.

STCK

Returns the elapsed CPU time as an unsigned 64-bit number.

FULL

Returns the elapsed CPU time as a printable string. FULL is the default. Specifying FULLB removes all leading zeros and associated separators. In each case, 12 characters are returned in the format hh:mm:ss.tho.

SEC

Returns the elapsed CPU time, in seconds, as a REXX numeric value. The value is accurate to three decimal places.

Return Codes

101

ARG 1 MISSING OR INVALID

Usage Notes

The CPUTIME value includes REXX interpretation time and time that ADDRESS environments use that execute in the same address space as the IMOD. Time that is accrued in other address spaces is not considered.

Example

/* Display the elapsed CPU time for an IMOD */

   time = cputime('fullb')
   time = strip(time,'l')      /* Remove leading blank characters */
   say 'CPU Time for' imod_id 'is' time