By measuring time data between interrupts the period can be established and RPM calculated ... You won’t be limited to an IR sensor, but can use a hall effect sensor in the same basic fashion.
This one is almost too simple, but it might come in handy. It turns out that Pabst fans (and probably several others) already have the circuitry for RPM monitoring. Pop it apart allow pcb access ...