Measuring duration of voltage peak

since its sound waves it only going to halt process for a few millis or even micros.

That is true, but I think that using a while loop is a bad habit to get into and is best avoided.