OPT LARGE MODULE 'dos/dos' CONST TICKS_PER_MINUTE=TICKS_PER_SECOND*60, LOTS_OF_TIMES=500000 DEF x, y, offset PROC fred(n) DEF i i:=n+x ENDPROC /* Repeat evaluation of an expression */ PROC repeat(exp) DEF i FOR i:=0 TO LOTS_OF_TIMES Eval(exp) /* Evaluate the expresssion */ ENDFOR ENDPROC /* Time an expression, and set-up offset if not done already */ PROC test(exp, message) DEF t IF offset=0 THEN offset:=time(`0) /* Calculate offset */ t:=time(exp) WriteF('\s:\t\d ticks\n', message, t-offset) ENDPROC /* Time the repeated calls, and calculate number of ticks */ PROC time(x) DEF ds1:datestamp, ds2:datestamp Forbid() DateStamp(ds1) repeat(x) DateStamp(ds2) Permit() IF CtrlC() THEN CleanUp(1) ENDPROC ((ds2.minute-ds1.minute)*TICKS_PER_MINUTE)+ds2.tick-ds1.tick PROC main() x:=9999 y:=1717 test(`x+y, 'Addition') test(`y-x, 'Subtraction') test(`x*y, 'Multiplication') test(`x/y, 'Division') test(`x OR y, 'Bitwise OR') test(`x AND y, 'Bitwise AND') test(`x=y, 'Equality') test(`x