RPM with MagneticFieldSensor Counter

I've been trying to incorporate a similar function in my app for several days.
Counter, duration ... All too difficult for me

https://youtu.be/n9yYcL7V7YQ
I want to calculate the RPM. I do not need graphic representation.

  1. Can someone give an example?
  2. Is there any other way to measure the RPM of a rotating object?

[personal info removed]

Dankeschön im vorraus

Use the magnetic sensor. First, create an app with some labels and add the sensor values to the labels. Do an experiment similar to the video and observe the label, notice which value will change when the metal object is close to the phone.