home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Distributions / ucb / spencer_2bsd.tar.gz / 2bsd.tar / src / pascal / tests / numericio.p < prev    next >
Text File  |  1980-02-17  |  378b  |  17 lines

  1. program numericIO(f,output);
  2.   const n = 500; d = 0.12345;
  3.   var i: integer; x,s: real;
  4.       f: file of real;
  5. begin writeln(wallclock);
  6.   x := 1.0; s := 0; rewrite(f);
  7.   for i := 1 to n do
  8.     begin write(f,x); s := s+x; x := x+d
  9.     end ;
  10.   writeln(wallclock, s);
  11.   reset(f); s := 0;
  12.   while not eof(f) do
  13.     begin read(f,x); s := s+x
  14.     end ;
  15.   writeln(wallclock, s)
  16. end .
  17.