home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / unistd / sleep.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-12  |  301 b   |  14 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <unistd.h>
  3. #include <time.h>
  4. #include <dpmi.h>
  5.  
  6. unsigned int
  7. sleep(unsigned int _seconds)
  8. {
  9.   clock_t start_time = clock();
  10.   while (clock()-start_time < _seconds * CLOCKS_PER_SEC)
  11.     __dpmi_yield();
  12.   return 0;
  13. }
  14.