Fan speed, is pulse counter the best way?

Hi,

I am getting the speed of a fan via a square wave output from the fan itself. At maximum speed I get a 100Hz signal. At the moment I am using the Pulse Counter to get the signal as pulses per minute and multiply it by 0.0166667 to get the frequenzy in Hz (or pulses per second). Is there a better way to get pulses or a frequency of a signal based on a per second value rather than per minute ? Here how I have it currently on my ESP32.

sensor:
  - platform: pulse_counter
    pin: GPIO4
    update_interval: 5s
    name: "Pulse Counter"
    id: pulsecounter
    filters:
      - multiply: 0.0166667
    unit_of_measurement: "Hz"

  - platform: template
    name: "RPM"
    update_interval: 5s
    lambda: |-
      return (id(pulsecounter).state * 30);
    unit_of_measurement: "rpm"

The template is just for convenience of displaying the actual RPM instead the frequency. Not relevant to my actual question I suppose.

Thanks
Jan