2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,31 +1,27 @@
|
|||
/*REXX program to show the elapsed time for a function (or subroutine). */
|
||||
arg times . /*get the arg from command line. */
|
||||
if times=='' then times=100000 /*any specified? No, use default*/
|
||||
/*REXX program displays the elapsed time for a REXX function (or subroutine). */
|
||||
arg reps . /*obtain an optional argument from C.L.*/
|
||||
if reps=='' then reps=100000 /*Not specified? No, then use default.*/
|
||||
call time 'Reset' /*only the 1st character is examined. */
|
||||
junk = silly(reps) /*invoke the SILLY function (below). */
|
||||
/*───► CALL SILLY REPS also works.*/
|
||||
|
||||
call time 'R' /*only 1st character is examined.*/
|
||||
call time 'reset' /*this verbose version also works*/
|
||||
call time 'rompishness' /*and yet another example. */
|
||||
|
||||
junk = silly(times) /*invoke the SILLY function. */
|
||||
/* CALL SILLY TIMES also works.*/
|
||||
|
||||
/*The E is for elapsed time.*/
|
||||
/* │ */
|
||||
/* ┌────────┘ */
|
||||
/* │ */
|
||||
/* ↓ */
|
||||
say 'function SILLY took' format(time("E"),,2) 'seconds for' times "iterations."
|
||||
/* ↑ */
|
||||
/* │ */
|
||||
/* ┌────────────────┘ */
|
||||
/* │ */
|
||||
/* The above 2 for the FORMAT function displays the time */
|
||||
/* with 2 decimal digits (past the decimal point). Using */
|
||||
/* a 0 (zero) would round the time to whole seconds. */
|
||||
exit
|
||||
/*──────────────────────────────────SILLY subroutine────────────────────*/
|
||||
silly: procedure /*chew up some CPU time doing some silly stuff.*/
|
||||
do j=1 for arg(1) /*wash, apply, lather, rinse, repeat. ... */
|
||||
a.j=random() date() time() digits() fuzz() form() xrange() queued()
|
||||
end /*j*/
|
||||
return j-1
|
||||
/* The E is for elapsed time.*/
|
||||
/* │ ─ */
|
||||
/* ┌────◄───┘ */
|
||||
/* │ */
|
||||
/* ↓ */
|
||||
say 'function SILLY took' format(time("E"),,2) 'seconds for' reps "iterations."
|
||||
/* ↑ */
|
||||
/* │ */
|
||||
/* ┌────────►───────┘ */
|
||||
/* │ */
|
||||
/* The above 2 for the FORMAT function displays the time with*/
|
||||
/* two decimal digits (rounded) past the decimal point). Using */
|
||||
/* a 0 (zero) would round the time to whole seconds. */
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*────────────────────────────────────────────────────────────────────────────*/
|
||||
silly: procedure /*chew up some CPU time doing some silly stuff.*/
|
||||
do j=1 for arg(1) /*wash, apply, lather, rinse, repeat. ··· */
|
||||
@.j=random() date() time() digits() fuzz() form() xrange() queued()
|
||||
end /*j*/
|
||||
return j-1
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
/*REXX program shows the CPU time used for a REXX pgm since it started. */
|
||||
arg times . /*get the arg from command line. */
|
||||
if times=='' then times=100000 /*any specified? No, use default*/
|
||||
junk = silly(times) /*invoke the SILLY function. */
|
||||
/* CALL SILLY TIMES also works.*/
|
||||
/*REXX program displays the elapsed time for a REXX function (or subroutine). */
|
||||
arg reps . /*obtain an optional argument from C.L.*/
|
||||
if reps=='' then reps=100000 /*Not specified? No, then use default.*/
|
||||
call time 'Reset' /*only the 1st character is examined. */
|
||||
junk = silly(reps) /*invoke the SILLY function (below). */
|
||||
/*───► CALL SILLY REPS also works.*/
|
||||
|
||||
/*The J is for time used by */
|
||||
/* │ the REXX program */
|
||||
/* ┌────────┘ since it started, */
|
||||
/* │ this is a Regina extension. */
|
||||
/* ↓ */
|
||||
say 'function SILLY took' format(time("J"),,2) 'seconds for' times "iterations."
|
||||
/* ↑ */
|
||||
/* │ */
|
||||
/* ┌────────────────┘ */
|
||||
/* │ */
|
||||
/* The above 2 for the FORMAT function displays the time */
|
||||
/* with 2 decimal digits (past the decimal point). Using */
|
||||
/* a 0 (zero) would round the time to whole seconds. */
|
||||
exit
|
||||
/*──────────────────────────────────SILLY subroutine────────────────────*/
|
||||
silly: procedure /*chew up some CPU time doing some silly stuff.*/
|
||||
do j=1 for arg(1) /*wash, apply, lather, rinse, repeat. ... */
|
||||
a.j=random() date() time() digits() fuzz() form() xrange() queued()
|
||||
end /*j*/
|
||||
return j-1
|
||||
/* The J is for the CPU time used */
|
||||
/* │ by the REXX program since */
|
||||
/* ┌───────┘ since the time was RESET. */
|
||||
/* │ This is a Regina extension.*/
|
||||
/* ↓ */
|
||||
say 'function SILLY took' format(time("J"),,2) 'seconds for' reps "iterations."
|
||||
/* ↑ */
|
||||
/* │ */
|
||||
/* ┌────────►───────┘ */
|
||||
/* │ */
|
||||
/* The above 2 for the FORMAT function displays the time with*/
|
||||
/* two decimal digits (rounded) past the decimal point). Using */
|
||||
/* a 0 (zero) would round the time to whole seconds. */
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*────────────────────────────────────────────────────────────────────────────*/
|
||||
silly: procedure /*chew up some CPU time doing some silly stuff.*/
|
||||
do j=1 for arg(1) /*wash, apply, lather, rinse, repeat. ··· */
|
||||
@.j=random() date() time() digits() fuzz() form() xrange() queued()
|
||||
end /*j*/
|
||||
return j-1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue