Measuring distance with hc-sr04

That might work. How would you go about stabilizing the initial reading before saving it?