Rpm counter IR tachometer - Help needed

Hello,

From this code posted above for the rpm sensor can anyone explain the line : rpm = 30*1000/(millis() - timeold)*rpmcount;

From what I have gathered 'rpmcount' will be the number of interrupts, '(millis() - timeold)' the time duration between the rpm value updating and '30*1000' derived from having two two interrupts per revolution. Correct ?

Either way I dont understand how that calculation gives rpm

Sorry im somewhat new to this.

Thanks