From 5cb9140924e8471d6ec6cfe6a14d23017adeea8f Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Wed, 21 Mar 1990 19:06:27 +0000 Subject: [PATCH] add LCC - a better C-Compiler for WEGA --- WEGA/contrib/lcc/lib/libc/port/gen/clock.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 WEGA/contrib/lcc/lib/libc/port/gen/clock.c diff --git a/WEGA/contrib/lcc/lib/libc/port/gen/clock.c b/WEGA/contrib/lcc/lib/libc/port/gen/clock.c new file mode 100644 index 0000000..37f88d5 --- /dev/null +++ b/WEGA/contrib/lcc/lib/libc/port/gen/clock.c @@ -0,0 +1,17 @@ +#include +#include +#define HZ 50 +#define TIMES(B) (B.tms_utime+B.tms_stime+B.tms_cutime+B.tms_cstime) + +extern long times(); +static long first = 0L; + +long +clock() +{ + struct tms buffer; + + if (times(&buffer) != -1L && first == 0L) + first = TIMES(buffer); + return ((TIMES(buffer) - first) * (1000000L/HZ)); +}