/*
	BMAO.C

	Determines the execution time of the analog functions eioBrdDI()
	and eioBrdAO().	
*/

#use vdriver.lib
#use eziopk23.lib

main() {
	auto unsigned i;
	auto unsigned long tEmpty, tAnOut, tDigIn;
	
	VdInit();

	printf("Checking timing, please wait...\n\n");
	
	_eioSetupAO1st();
	tEmpty = MS_TIMER;
	for (i = 0; i < 10000; ++i) {
	}
	tEmpty = MS_TIMER - tEmpty;
	tDigIn = MS_TIMER;
	for (i = 0; i < 10000; ++i) {
		eioBrdDI(0);
	}
	tDigIn = MS_TIMER - tDigIn - tEmpty;
	tAnOut = MS_TIMER;
	for (i = 0; i < 10000; ++i) {
		eioBrdAO(0,0);
	}
	tAnOut = MS_TIMER - tAnOut - tEmpty;
	printf("eioBrdDI takes %5.3fms to execute\n",(float)tDigIn/10000.0);
	printf("eioBrdAO takes %7.3fms to execute\n",(float)tAnOut/10000.0);
}