Sonar Ruler is an experimental app that uses echoes to measure distances with your iPhone!
It uses the same principles that dolphins use to find food.
It sends a short pulse from the speaker and measures how long that pulse takes to bounce off of something and return to the phone. It then estimates how far away you are.