Digital Tachometer for car

Panici:
Ah, I meant to say the length of the pulse.

Actually right now i'm not using that for my calculations. I'm just counting how many pulses per 200ms.

Alright, if you want to use the length of the pulse directly there are at least a couple different ways to do it. First, you can do a direct calcuation using the value in the pulse variable. Second, since each pulse length corresponds to one RPM value in a linear fashion it would be possible to do the math ahead of time to figure what pulse length correlates to the nearest integer value of RPM. Then just use the map() function to convert pulse right after reading it.

Psuedo code example as follows (you would have to use of course have exact numbers or constant/variable names where I have bracketed labels)...

RPM = map(pulse, , , , );

Mapping the value can be faster and use less space than conversions through direct calculation, but in this specific case might not yield a significant improvement.