R.p.m for unknown dc motor

I Have an unknown dc motor :
I know it's work 9-24 volt
And max current can take is 1.5-2 A
I want to know how many r.p.m without load
I tried optical sensor and put on the motor a piece of paper
And in every cycle the counter in my code will increase for 1 min but the opta didn't work maybe it's broken
Please suggest more than one way to do that?!

Record the sound with a microphone and put the audio through an FFT program to spot the fundamental
frequency which will be the rps, multiply by 60 to get rpm.