home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_5 / issue_06 / benchmarks / c_source / gscrn < prev    next >
Encoding:
Text File  |  1991-04-27  |  665 b   |  33 lines

  1. /* grafscrn */
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <time.h>
  6.  
  7. main()
  8. {
  9.     int i,j,x,y;
  10.     int gdriver=DETECT, gmode, errorcode;
  11.     clock_t start, end;
  12.  
  13.     initgraph(&gdriver, &gmode, "");
  14.  
  15.     errorcode=graphresult();
  16.     if (errorcode != grOk)
  17.     {
  18.       printf("Graphics error: %s\n", grapherrormsg(errorcode));
  19.       exit(1);
  20.     }
  21.     x=10;
  22.     y=20;
  23.     start=clock(); /* begin timing */
  24.     printf("start\n");
  25.     cleardevice();
  26.     for (i=0; i<100; i++)
  27.         for (j=0; j<100; j++)
  28.         outtextxy( x, y, ".");
  29.        end=clock();
  30.        printf("\n");
  31.        printf("The timing for this Screen Test was %f\n", (end-start) / CLK_TCK);
  32. };
  33.