Calculating the speed of my Hall Sensored BLDC Motor using ZS-X11H controller and Arduino

Hello all, hope you're doing well.
I got a brushless motor with 3 Hall sensors inside it. It is 3-phase motor and I want to write a code to calculate the speed in RPM of the motor. I know that using the hall sensors, the speed can be calculated, but I'm new and I don't know how to read the hole sensors and do the calculations. I appreciate any advice or help!


I have connected the 3phase and power supply, and also the wires of the hall sensors.