Measure distance.