CPUTM

Return the accumulated CPU time

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
xcall CPUTM(time)

Arguments

time

Returned with the accumulated CPU time. (n)

Discussion

The CPUTM subroutine returns the CPU time accumulated by the current process.

On UNIX, the CPU time accumulated includes CPU time for all child processes that the runtime waits for (for example, XCALL SPAWN and XCALL SHELL, but not XCALL RUNJB).

CPU time is accumulated for an entire process, not for a program or programs within the process. The returned numeric value represents the number of 10 millisecond intervals (tics) accumulated.

The CPU time is not zeroed out at the beginning of a Synergy program. To measure the CPU time consumed by a program, you must sample the CPU time at program startup and again at the checkpoint, and then subtract the first value from the second.

Tip

We recommend you use %CPUTIME instead of the CPUTM subroutine. (See %CPUTIME.)

Examples

record
    last        ,i4
    now         ,i4
proc
    xcall flags(1001010, 1)
    open(1, o, "TT:")
    xcall cputm(last)
    xcall doit
    xcall cputime(now)
    writes(1, "Elapsed time = " + %string(now - last))
    close 1
    stop
end