An ophthalmic apparatus may include: a light source of wavelength sweeping type; a measurement optical system; a reference optical system; a light receiving element that receives interference light; a sample clock signal generator that generates a sample clock signal from the light from the light source, the sample clock signal cyclically changing at equal frequency intervals; a signal processor that samples an interference signal based on the sample clock signal, the interference signal being outputted from the light receiving element when the light receiving element receives the interference light. The ophthalmic apparatus generates period data based on the sample clock signal, the period data indicating a relationship between a period of the sample clock signal and time; and determines a processing duration of the interference signal sampled at the signal processor based on the period data.