Square wave generator and frequency meter

Perhaps try a simple loop that toggles an LED (aka output pin). Then use a NOP loop to slow it down. Should be very consistent.
Also disable the millis() timer. Or simply shut off all interrupts.

I believe this will be as stable as an arduino is capable of.

uint_16 i

for ( i, i = 16384, i++){

     asm(“nop\n\t”)		//16Mhz Arduino  ~ 62.5ns

     asm ("sbi %0, %1 \n": : "I" (_SFR_IO_ADDR(PINB)), "I" (PINB5)); 		// Toggle LE
}