Correct calculation of measurement cycle for distance sensor.