Disclosed is a digital ultrasonic instrument for measuring the corneal thickness (often referred to as a pachymeter) and for measuring the axial length of the eye (often referred to as a biometric ruler). A number representing corneal thickness or axial length is displayed digitally on a liquid crystal display. The pachymeter incorporates a 20 MHz solid phase piezoelectric transducer, a microprocessor, a gate array, a hybrid analog receiver circuit, a liquid crystal display and four batteries. When axial length is measured, the instrument operates as a biometric ruler, a 10 MHz transducer is used and the software in the microprocessor is modified. Ultrasonic echoes generated by the transducer and various interfaces in the eye are sampled at the rate of 40 MHz which results in equal or greater sensitivity, resolution and accuracy as compared to other pachymeters and biometric rulers currently available. The 40 MHz sample rate is accomplished by use of a grey code counter and a binary counter, each of which is sampled twice after an ultrasonic echo is detected. The two grey code samples are compared to determine a valid sample period. A counter value obtained during a valid sample period is recorded in a shift register and compared to subsequent counter values corresponding to subsequent ultrasonic echoes. The apparatus for correlating ultrasonic echoes with particular counter values assures that the counter will be sampled at a point in time when the counter is stable as opposed to being in a state of transition. The apparatus allows for a counter accuracy of 25 ns.