Electronic flowmeter

Hello,I am working on a project of electronic flowmeter in which input to microcontroller is from IR sensor.I have to display the RPM count and send a message to a particular mobile no.So can anyone help me out in code for calculating the RPM count and sending it to a mob no.Please help as soon as possible.