cray-time.red 464 B

123456789101112131415161718192021222324
  1. % A small timing test to compare DEC-20, VAX and Cray
  2. % in syslisp and FORTRAN and C
  3. % An iterative FACTORIAL
  4. on comp;
  5. on syslisp;
  6. syslsp procedure IFAC n;
  7. begin scalar m;
  8. m:=1;
  9. while n >0 do <<m:=m*n; n := n-1>>;
  10. return m;
  11. end;
  12. procedure NCALL(N,M);
  13. begin scalar tim1,tim2,i;
  14. tim1:=time();
  15. while N>0 do <<i:=Ifac(m);n:=n-1>>;
  16. tim2:=time()-tim1; %/had bug if same tim
  17. printf(" took %p ms%n",tim2);
  18. end;
  19. off syslisp;