Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Microcontroller e.g. PIC - easy to do but limited accuracy
Analogue method with analogue output - possible but tricky to get accurate.
Out of those, I would look at the microcontroller method unless you need very high resolution. I am not sure of the PIC timer/capture resolution, but I think a 20MHz should be around 200ns, but I may be wrong.