Return the accumulated CPU time

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
cpu_time = %CPUTIME

Return value


The CPU time accumulated by the current process. The returned value represents the number of 10 millisecond intervals (tics) accumulated. The result is integer data type. (i)


%CPUTIME is evaluated at runtime and is an alternative to the CPUTM subroutine.

On Windows, the time is elapsed time, not accumulated system time.

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).

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.

%CPUTIME is functionally equivalent to the CPUTM subroutine.


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