Need Help with Piezo Buzzer and Ultrasonic Sensor code

Test time.
What does hysteresis do in the code?