PROGRAM BENCHMARK (OUTPUT);
(* PCW DECEMBER 1980 PP59-61 *)
TYPE STRING=PACKED ARRAY [1..11] OF CHAR;
VAR J,K,L: INTEGER;
    X,Y: REAL;
    MATRIX: ARRAY [0..10] OF INTEGER;
    TOD: STRING;
 
PROCEDURE TIME(VAR TOD: STRING); EXTERNAL;
 
PROCEDURE NONE5;
BEGIN
  J:=1
END;
PROCEDURE NONE4;
BEGIN
  NONE5
END;
PROCEDURE NONE3;
BEGIN
  NONE4
END;
PROCEDURE NONE2;
BEGIN
  NONE3
END;
PROCEDURE NONE1;
BEGIN
  NONE2
END;
 
PROCEDURE VALUE5(I:INTEGER);
BEGIN
  I:=1
END;
PROCEDURE VALUE4(I:INTEGER);
BEGIN
  VALUE5(I)
END;
PROCEDURE VALUE3(I:INTEGER);
BEGIN
  VALUE4(I)
END;
PROCEDURE VALUE2(I:INTEGER);
BEGIN
  VALUE3(I)
END;
PROCEDURE VALUE1(I:INTEGER);
BEGIN
  VALUE2(I)
END;
 
PROCEDURE REFER5(VAR I:INTEGER);
BEGIN
  I:=1
END;
PROCEDURE REFER4(VAR I:INTEGER);
BEGIN
  REFER5(I)
END;
PROCEDURE REFER3(VAR I:INTEGER);
BEGIN
  REFER4(I)
END;
PROCEDURE REFER2(VAR I:INTEGER);
BEGIN
  REFER3(I)
END;
PROCEDURE REFER1(VAR I:INTEGER);
BEGIN
  REFER2(I)
END;
 
BEGIN
  TIME(TOD); WRITELN(TOD,' MAGNIFIER');
  FOR K:=1 TO 10000 DO;
 
  TIME(TOD); WRITELN(TOD,' FOR LOOP');
  FOR K:=1 TO 10000 DO
    FOR J:=1 TO 10 DO;
 
  TIME(TOD); WRITELN(TOD,' WHILE LOOP');
  FOR K:=1 TO 10000 DO
  BEGIN
    J:=1;
    WHILE J<10 DO J:=J+1;
  END;
 
  TIME(TOD); WRITELN(TOD,' REPEAT LOOP');
  FOR K:=1 TO 10000 DO
  BEGIN
    J:=1;
    REPEAT
      J:=J+1
    UNTIL J>10;
  END;
 
  TIME(TOD); WRITELN(TOD,' LITERAL ASSIGN');
  FOR K:=1 TO 10000 DO
    FOR J:=1 TO 10 DO L:=0;
 
  TIME(TOD); WRITELN(TOD,' MEMORY ACCESS');
  FOR K:=1 TO 10000 DO
    FOR J:=1 TO 10 DO L:=J;
 
  TIME(TOD); WRITELN(TOD,' REAL ARITHMETIC');
  FOR K:=1 TO 10000 DO
    X:=K/2*3+4-5;
 
  TIME(TOD); WRITELN(TOD,' REAL ALGEBRA');
  FOR K:=1 TO 10000 DO
    X:=K/K*K+K-K;
 
  TIME(TOD); WRITELN(TOD,' VECTOR');
  MATRIX[0]:=1;
  FOR K:=1 TO 10000 DO
    FOR J:=1 TO 10 DO MATRIX[J]:=MATRIX[J-1];
 
  TIME(TOD); WRITELN(TOD,' EQUAL IF');
  FOR K:=1 TO 10000 DO
    FOR J:=1 TO 10 DO IF J<6 THEN L:=1 ELSE L:=0;
 
  TIME(TOD); WRITELN(TOD,' UNEQUAL IF');
  FOR K:=1 TO 10000 DO
    FOR J:=1 TO 10 DO IF J<2 THEN L:=1 ELSE L:=0;
 
  TIME(TOD); WRITELN(TOD,' NO PARAMETERS');
  J:=0;
  FOR K:=1 TO 10000 DO NONE1;
 
  TIME(TOD); WRITELN(TOD,' VALUE');
  J:=0;
  FOR K:=1 TO 10000 DO VALUE1(J);
 
  TIME(TOD); WRITELN(TOD,' REFERENCE');
  J:=0;
  FOR K:=1 TO 10000 DO REFER1(J);
 
  TIME(TOD); WRITELN(TOD,' MATHS');
  FOR K:=1 TO 10000 DO
  BEGIN
    X:=EXP(K/1000);
    Y:=SIN(K);
  END;
 
  TIME(TOD); WRITELN(TOD,' END OF PCW BENCHMARK');
END.
