That's what I'm trying to do, I was counting the rising of the pulses but measuring the time between two pulses will be more accurate, thanks for your answers! They were helpful.arg, I can't stand it any more...
Measure the time between two pulses. The rest is left as an exercise to the student.