The Serial.println(digitalRead(echo)) statement will limit the resolution of your while loop.
digitalRead is 4 microseconds and there are two of these per loop.
More significantly Serial.println is at least 10_bitsPerChar / baudrate * numberOfCharacters with at least 3 characters per loop (0, carriage return, line feed). At 9600 baud this would be something over 3 milliseconds.
The speed of sound is about 340 meters/second so 3 milliseconds time LSB gives about 1 meter round trip distance resolution which is a pretty lousy implementation for a sensor with an effective range of a couple meters.
If you lose the print inside your while loop, the program should work well enough to demonstrate the concept.