A vision measuring device comprising an imaging device of which exposure time is variable, the vision measuring device being adapted for measuring a workpiece by imaging said workpiece by said imaging device, and further comprising: an illumination device arranged to be controlled to emit light at a certain emission frequency and irradiate the workpiece with illumination light; a linear encoder arranged to control and to output an in-focus position of the imaging device in an in-focus axis direction; a position control system arranged to control the in-focus position of the imaging device, and arranged to acquire the in-focus position of the imaging device from the linear encoder and and further arranged to output the in-focus position as information representing a position in an in-focus axis direction; and said vision measuring comprising a control device, and being arranged to perform: a normal measurement in which the imaging device images the workpiece with a frame rate and the illumination device irradiates the workpiece; and an auto-focusing process comprising acquiring the in-focus position at which an image with the highest contrast is acquired, said control device being arranged to set, during auto-focussing, the exposure time of the imaging device to an integral multiple of a lighting period of an interior lamp based on which of a first frequency, for example 100Hz, and a second frequency, for example 120Hz, a lighting frequency of the interior lamp is, wherein the emission frequency of the illumination device is set to a common multiple of the first frequency and the second frequency, for example an integral multiple of 600Hz. an illumination device arranged to be controlled to emit light at a certain emission frequency and irradiate the workpiece with illumination light; a linear encoder arranged to control and to output an in-focus position of the imaging device in an in-focus axis direction; a position control system arranged to control the in-focus position of the imaging device, and arranged to acquire the in-focus position of the imaging device from the linear encoder and and further arranged to output the in-focus position as information representing a position in an in-focus axis direction; and said vision measuring comprising a control device, and being arranged to perform: a normal measurement in which the imaging device images the workpiece with a frame rate and the illumination device irradiates the workpiece; and an auto-focusing process comprising acquiring the in-focus position at which an image with the highest contrast is acquired, said control device being arranged to set, during auto-focussing, the exposure time of the imaging device to an integral multiple of a lighting period of an interior lamp based on which of a first frequency, for example 100Hz, and a second frequency, for example 120Hz, a lighting frequency of the interior lamp is, wherein the emission frequency of the illumination device is set to a common multiple of the first frequency and the second frequency, for example an integral multiple of 600Hz. a normal measurement in which the imaging device images the workpiece with a frame rate and the illumination device irradiates the workpiece; and an auto-focusing process comprising acquiring the in-focus position at which an image with the highest contrast is acquired, said control device being arranged to set, during auto-focussing, the exposure time of the imaging device to an integral multiple of a lighting period of an interior lamp based on which of a first frequency, for example 100Hz, and a second frequency, for example 120Hz, a lighting frequency of the interior lamp is, wherein the emission frequency of the illumination device is set to a common multiple of the first frequency and the second frequency, for example an integral multiple of 600Hz.