/* --------------------- rexx procedure ---------------------- * * Name: Timer * * * * Function: Time the repetitive execution of a REXX exec * * * * Invoke * * Syntax: %TIMER exec / count * * * * Author: Lionel B. Dyck * * Kaiser Permanente IT * * 25 N. Via Monte Ave * * Walnut Creek, California 94598 * * * * History: * * 01/06/94 - add syscpu as well * * and offset count by / * * 09/11/91 - changed to use sysvar(syssrv) * * 08/09/91 - modified to report average time * * - change to use tso time for service * * 01/23/91 - Creation of this exec * * ------------------------------------------------------------- */ arg input if length(input) = 0 then exit 8 if pos("/",input) > 0 then parse value input with exec "/" count else do exec = input count = 1 end say "Starting the time test of" exec "for" count "times" s_service = sysvar('SYSSRV') s_time = sysvar('SYSCPU') do count exec end e_service = sysvar('SYSSRV') e_time = sysvar('SYSCPU') total_service = e_service - s_service total_time = e_time - s_time say "REXX Procedure" exec "executed" count, "times with average service units of" total_service/count say "and a total cpu time of:" total_time/count