I would suggest you look at the I/O pins. You can turn on interrupts on most of the IO pins to detect, and interrupt, voltage changes on an interrupt pin. You can then make the interrupt routines store the time-of-day at the start of a signal, and then work out the elapsed time at the end of the signal.