A method of measuring distance by an endoscope includes a step of imaging and a step of measuring distance. the step of imaging includes a step of producing out an image taken by an imaging unit. The step of measuring distance includes a step of moving the axis of sighting of the imaging unit and a step of computing a distance to a subject of interest on the basis of a first image taken before the step of moving, a second image taken during the step of moving and the amount of distance-measurement control.