home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol6n20.zip / FIGURES.ZIP / FIGURE.2 < prev    next >
Text File  |  1987-10-16  |  438b  |  21 lines

  1. PROGRAM Test_Length;
  2. CONST Reps = 10000;
  3. VAR
  4.   S : string[255];
  5.   B : byte;
  6.   N : integer;
  7. {$I timer.inc}
  8.  
  9. BEGIN
  10.   timer(on);
  11.   FOR N := 1 to reps DO B := length(S);
  12.   timer(off);
  13.   Write(reps,' repetitions of "length(S)" took ');
  14.   WriteLn(time:1:2,' seconds');
  15.   timer(on);
  16.   FOR N := 1 to reps DO B := ord(S[0]);
  17.   timer(off);
  18.   Write(reps,' repetitions of "ord(S[0])" took ');
  19.   WriteLn(time:1:2,' seconds');
  20. END.
  21.