/*

    l_main.c

*/


#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include "dosasm.h"
#include "l_main.h"


void    l_init(void) {
    EnableTimerInt();


    }

void    l_shutdown(void) {
    DisableTimerInt();

    }

int     l_gettime(void)
{
  unsigned long data[3];
  double ticks;

  do
    GetTimerAsm(data);
  while(data[0]!=data[1]);

  ticks=data[0]+data[2]/(65536.0*65536.0);

   return (int)(ticks*1000000/18.20649719);
}

int     l_gettimedif(void) {
/*not used*/
    return 0;
    }