home *** CD-ROM | disk | FTP | other *** search
- /* sys/clock.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
-
- #include <sys/emx.h>
- #include <os2emx.h>
- #include "syscalls.h"
-
- /* This function requires QSV_TIME_LOW/QSV_TIME_HIGH to be synchronized */
- /* with QSV_MS_COUNT, that is, the first timer is incremented at the */
- /* same time as the latter one. */
-
- long long __clock (void)
- {
- ULONG val_lo, val_hi, val_ms;
- long long res;
-
- _sys_get_clock (&val_lo, &val_hi, &val_ms);
- res = (long long)(((val_ms - _sys_clock0_ms) % 1000) / 10)
- + 100 * (((long long)val_hi << 32) + (long long)val_lo -
- ((long long)_sys_clock0_hi << 32) + (long long)_sys_clock0_lo);
- return (res);
- }
-