/*
	BMDIO.C

	Determines the execution time of the digital functions eioBrdDI() and
	eioBrdDO().
*/

#use vdriver.lib
#use eziopk23.lib

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

	printf("Checking timing, please wait...\n\n");
	
	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;
	tDigOut = MS_TIMER;
	for (i = 0; i < 10000; ++i) {
		eioBrdDO(0,0);
	}
	tDigOut = MS_TIMER - tDigOut - tEmpty;
	printf("eioBrdDI takes %5.3fms to execute\n",(float)tDigIn/10000.0);
	printf("eioBrdDO takes %5.3fms to execute\n",(float)tDigOut/10000.0);
}