File: headers\uclock.h

    1 /*
    2 **  UCLOCK.H
    3 **
    4 **  Original Copyright 1988-1991 by Bob Stout as part of
    5 **  the MicroFirm Function Library (MFL)
    6 **
    7 **  This subset version is functionally identical to the
    8 **  version originally published by the author in Tech Specialist
    9 **  magazine and is hereby donated to the public domain.
   10 */
   11 
   12 #ifndef UCLOCK_H_INCLUDED
   13 #define UCLOCK_H_INCLUDED
   14 
   15 #include <dos.h>
   16 #include <time.h>
   17 
   18 #if defined(__ZTC__)
19 #include <int.h> 20 #undef int_on 21 #undef int_off
22 #elif defined(__TURBOC__)
23 #define int_on enable 24 #define int_off disable 25 #ifndef inp 26 #define inp inportb 27 #endif 28 #ifndef outp 29 #define outp outportb 30 #endif
31 #else /* assume MSC/QC */ 32 #include <conio.h> 33 #define int_on _enable 34 #define int_off _disable 35 #ifndef MK_FP 36 #define MK_FP(seg,offset) \ 37 ((void far *)(((unsigned long)(seg)<<16) | (unsigned)(offset))) 38 #endif 39 #endif 40 41 /* ANSI-equivalent declarations and prototypes */ 42 43 typedef unsigned long uclock_t; 44 45 #define UCLK_TCK 1000000L /* Usec per second - replaces CLK_TCK */ 46 47 #if __cplusplus
48 extern "C" {
49 #endif 50 51 uclock_t usec_clock(void); 52 void restart_uclock(void); 53 54 #if __cplusplus
55 }
56 #endif 57 #endif 58