#include  "timer.h"
#include<sys/time.h>

// simple timing routines for testing
// these use global variables, so they will not interleave well

long secs, usecs;
struct timeval tt;

void StartTheClock()
{
  gettimeofday(&tt,NULL);
  secs=tt.tv_sec;
  usecs=tt.tv_usec;
}

long StopTheClock()
{
  gettimeofday(&tt,NULL);
  secs=tt.tv_sec-secs;
  usecs=tt.tv_usec-usecs;
  return (long) 1000*secs+(usecs/1000);
}
