/* clock -- return process time used so far, in units of CLK_TCK ticks per second (under TOS, 200 per second) */ /* written by ERS */ #include #include extern clock_t _starttime; /* in main.c */ static clock_t now; /* this must execute in supervisor mode; it fetches the system variable * containing the number of 200HZ ticks since the system was booted */ static void getnow() { now = *((unsigned long *) 0x4ba); } clock_t clock() { (void)Supexec(getnow); return (now - _starttime); }