Using IR sensor and IR receiver to measure the speed of the shaft

Thank you for the response. I will incorporate your comments in my code and see what happens.