/*
 * $Id: timetester2.c,v 1.5 2000/12/04 03:37:03 alderman Exp $
 */
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
// #include <values.h>
#include <sys/time.h>

#include "options.h"
#include "timer.h"

int main(int argc, char *argv[]) {
	int ctr = 0, errctr = 0;
	extern int block_size;
	extern int bit_rate;

	parseArgs(argc, argv);
	if(validateParams() != VALIDATION_SUCCESS) {
		printUsage();
		exit(1);
	}

	init_timer(block_size, bit_rate);

	while(1) {
		printf("Starting program.\n");
		system("/usr/bin/perl factor.pl > /dev/null");

		++ctr;
		if(sleep_end_quantum_increment()) {
			++errctr;
		}
		printf("Period %d, %d errors\n",ctr,errctr);
	}	
}
