home *** CD-ROM | disk | FTP | other *** search
- /* Macros for implementing simple timers. All timers use 1000ths of
- a second, but are only 'accurate' to one clock tick. */
-
- #ifndef CLOCKS_PER_SEC
- #define CLOCKS_PER_SEC CLK_TCK
- #endif
-
- #define timerset(tmt) (clock_t)((((clock_t)(tmt) * (clock_t)CLOCKS_PER_SEC) / 1000L) + clock())
- #define timeup(tmt) ((clock_t)(tmt) < clock())
- #define timeleft(tmt) (clock_t)((((clock_t)(tmt) - clock()) / (clock_t)CLOCKS_PER_SEC) * 1000L)
-