home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGC.ZIP / PROGC007.C < prev    next >
Text File  |  1988-04-10  |  817b  |  21 lines

  1.  
  2. /************************************************************************/
  3. /* Wait for start of next vertical retrace                              */
  4. /************************************************************************/
  5.  
  6. wait_4_vert()
  7.         {
  8.         int i;
  9.         long int count, ticks();
  10.         printf("\n...counting");
  11.         count = ticks();                        /* Get current tick     */
  12.         for (i = 0; i < 300; i++)
  13.                 vertical_retrace();             /* Wait for start of    */
  14.                                                 /* next vertical retrace*/
  15.         count = ticks() - count;
  16.         printf("\n300 vertical retraces took %ld ticks",count);
  17.         printf("\nThat is %d cycle refresh rate",
  18.                 (300 * (long)91)/(5 * count));
  19.         }
  20.  
  21.