home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_40.arc / C-REVIEW.ARC / DISKIO.C < prev    next >
C/C++ Source or Header  |  1987-09-23  |  648b  |  39 lines

  1. /*
  2.      Program: DiskIO
  3.      Version: 1.00
  4.      Date:    September 11, 1987
  5.  
  6.      Tests the speed of disk i/o library routines.
  7. */
  8.  
  9. #include <stdio.h>
  10.  
  11. main()
  12.      {
  13.      int i, j;
  14.      FILE *f;
  15.      char buf[100];
  16.  
  17.      f = fopen("diskio.tst","w+");
  18.  
  19.      for (i = 0; i < 1000; ++i)
  20.           {
  21.           for (j = 0; j < 78; ++j)
  22.                {
  23.                fputc('.',f);
  24.                }
  25.           fprintf(f," end line #%d\n",i);
  26.           }
  27.  
  28.      fclose(f);
  29.  
  30.      f = fopen("diskio.tst","r+");
  31.  
  32.      for (i = 0; i < 1000; ++i)
  33.           {
  34.           fgets(buf,100,f);
  35.           }
  36.  
  37.      fclose(f);
  38.      }
  39.