>An Arduino can by pretty small. Here is an Arduino compatible that can do exactly what you ask for. >https://www.sparkfun.com/products/12765 You can find these on eBay for a lower price. Yes, 3.1 version is even better, up to 60MHz: https://www.pjrc.com/teensy/td_libs_FreqCount.html A very good candidate for my problem.