dxx-rebirth/arch/linux/timer.c
Bradley Bell 9bd1ba7c47 This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.
2001-01-19 03:30:16 +00:00

21 lines
382 B
C

#include <conf.h>
#include <sys/time.h>
#include <stdio.h>
#include "maths.h"
static struct timeval tv_old;
fix timer_get_fixed_seconds(void)
{
fix x;
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
x=i2f(tv_now.tv_sec - tv_old.tv_sec) + fixdiv(i2f((tv_now.tv_usec - tv_old.tv_usec)/1000), i2f(1000));
return x;
}
void timer_init(void)
{
gettimeofday(&tv_old, NULL);
}