add LCC - a better C-Compiler for WEGA

This commit is contained in:
Oliver Lehmann 1990-03-21 19:06:27 +00:00
parent d1573ba93c
commit 5cb9140924
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#include <sys/types.h>
#include <sys/times.h>
#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));
}