home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / CLOCK.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  1KB  |  33 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /* =======================================================================
  4.     CLOCK.H     A simple macro based implementation of the ANSI/ISO
  5.                 standard clock() function and related items.
  6.  
  7.                 Some older C compilers for DOS do not implement these
  8.                 items. E.g.: Turbo C 1.5 ... This file fixes it.
  9.                 WARNING: There is no provision for handling the
  10.                 24-hour/midnight rollover problem.
  11.  
  12.                 Suggested use: #include this file _after_ time.h if
  13.                 there are problems related to clock().
  14.  
  15.                 v1.00  95-10-19  Initial version.
  16.  
  17.  _____          This version is Public Domain.
  18.  /_|__|         Auke Reitsma, Delft, The Netherlands.
  19. /  | \  --------------------------------------------------------------- */
  20.  
  21. #ifndef CLOCKS_PER_SEC
  22.  
  23. #include "extkword.h"   /* from Snippets, for definition of FAR */
  24.  
  25. typedef long clock_t;
  26. #define clock()         *((clock_t FAR *)0x0040006cL)
  27. #define CLOCKS_PER_SEC  18.2
  28. #define CLK_TCK         18.2   /* Non-ANSI/ISO but _very_ common. */
  29.  
  30. #endif
  31.  
  32. /* === clock.h end ===================================================== */
  33.