home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / SQDEV200.ZIP / SRC / TDELAY.C < prev    next >
C/C++ Source or Header  |  1994-05-23  |  2KB  |  65 lines

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *  Squish Developers Kit Source, Version 2.00                             *
  4.  *  Copyright 1989-1994 by SCI Communications.  All rights reserved.       *
  5.  *                                                                         *
  6.  *  USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE       *
  7.  *  SQUISH DEVELOPERS KIT LICENSING AGREEMENT IN SQDEV.PRN.  IF YOU DO NOT *
  8.  *  FIND THE TEXT OF THIS AGREEMENT IN THE AFOREMENTIONED FILE, OR IF YOU  *
  9.  *  DO NOT HAVE THIS FILE, YOU SHOULD IMMEDIATELY CONTACT THE AUTHOR AT    *
  10.  *  ONE OF THE ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO  *
  11.  *  USE THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE SQUISH          *
  12.  *  DEVELOPERS KIT LICENSING AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE *
  13.  *  ABLE TO REACH WITH THE AUTHOR.                                         *
  14.  *                                                                         *
  15.  *  You can contact the author at one of the address listed below:         *
  16.  *                                                                         *
  17.  *  Scott Dudley       FidoNet     1:249/106                               *
  18.  *  777 Downing St.    Internet    sjd@f106.n249.z1.fidonet.org            *
  19.  *  Kingston, Ont.     CompuServe  >INTERNET:sjd@f106.n249.z1.fidonet.org  *
  20.  *  Canada  K7M 5N3    BBS         1-613-634-3058, V.32bis                 *
  21.  *                                                                         *
  22.  ***************************************************************************/
  23.  
  24. #include <dos.h>
  25.  
  26. #define INCL_NOPM
  27. #define INCL_DOS    /* must be before prog.h */
  28.  
  29. #include "prog.h"
  30.  
  31. #if defined(OS_2)
  32.  
  33.   #include "pos2.h"
  34.  
  35.   void _fast tdelay(int msecs)
  36.   {
  37.       DosSleep((ULONG)msecs);
  38.   }
  39.  
  40. #elif defined(__MSDOS__)
  41.   #include <time.h>
  42.  
  43.   void _fast tdelay(int msecs)
  44.   {
  45.     clock_t ctEnd;
  46.  
  47.     ctEnd = clock() + (long)msecs * (long)CLK_TCK / 1000L;
  48.  
  49.     while (clock() < ctEnd)
  50.       ;
  51.   }
  52.  
  53. #elif defined(NT)
  54.  
  55.   #include "pwin.h"
  56.  
  57.   void _fast tdelay(int msecs)
  58.   {
  59.     Sleep((DWORD)msecs);
  60.   }
  61.  
  62. #else
  63.   #error Unknown OS
  64. #endif
  65.