#include "time.h"
#include "conio.h"

/****************************************************************************
*                                    pause
* Inputs:
*       short period: Number of ms to pause
* Effect:
*       Busy-waits for that period of time
* Notes:
*	From page 44 of the CTOOLS2 documentation
****************************************************************************/

void pause(long period)
    {
     clock_t tic_init;
     unsigned char ch;
     short scan;
     clock_t tics;

     tic_init = clock();
     period=(period*CLK_TCK)/1000;

     do
	{
	 tics = clock();
	 if (tics - tic_init > (time_t)period)
	    break;

	 /* See if user hit key */

	 if(kbhit())
	    { /* hit key */
	     getch();
	     break;
	    } /* hit key */

	}
	 while (tics - tic_init  < 6000);	/* no more than 60 seconds */
     return;
    }
