Sensor to measure engine RPM

I am using an slot optical interrupter. My results are mixed. I have a center of a CD (clear part) painted half black. In the code I can use the "pulseIn(high or low)", I have tried both and sum. Seems to work well at the higher speeds. Putting a 5ms delay between the high low count helped. I don't know why it isn't better tho. I am using the 3.3v supply thru the "S" to pin 10 and ground the pin 10 with 100ohm.