Previous Topic: CP()

Next Topic: D2P()

CPUTIME()

Use the CPUTIME() function to enable an IMOD task to determine how much CPU time it has consumed.

Syntax

The CPUTIME() function has this syntax:

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

Arguments

The CPUTIME() function takes these arguments:

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

The CPUTIME() function produces these return codes:

101

ARG 1 MISSING OR INVALID

Usage Notes

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

Example

Consider this 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