A computer-implemented method of controlling exposure time comprising: receiving an image of an eye from an image sensor, the image resulting from the image sensor detecting light during a first exposure time; determining a pupil intensity as an intensity of a representation of a pupil of the eye in the image; determining an iris intensity as an intensity of a representation of an iris of the eye in the image; determining a pupil-iris contrast as a contrast between the representation of the pupil in the image and the representation of the iris in the image; on a condition that the pupil intensity is determined to meet an intensity condition, determining an intensity compensated exposure time which is different from the first exposure time, wherein the determination comprises: on a condition that the pupil intensity is determined to be above a first intensity threshold, determining an intensity compensated exposure time that is shorter than the first exposure time by a predetermined decrement, wherein the first intensity threshold is set such that intensities above the first intensity threshold indicates saturation; on a condition that the pupil intensity is determined to be below the first intensity threshold and above a second intensity condition threshold, determining an intensity compensated exposure time that is shorter than the first exposure time, wherein a quotient between the intensity compensated exposure time and the first exposure time is proportional to the quotient between the second intensity threshold and the pupil intensity; and further on a condition that the pupil-iris contrast is determined to meet a contrast condition, determining a contrast compensated exposure time which is different from the first exposure time; and setting a second exposure time as the shorter of any determined intensity compensated exposure time and any determined contrast compensated exposure time, wherein the second exposure time is for application to the image sensor when capturing a further image. receiving an image of an eye from an image sensor, the image resulting from the image sensor detecting light during a first exposure time; determining a pupil intensity as an intensity of a representation of a pupil of the eye in the image; determining an iris intensity as an intensity of a representation of an iris of the eye in the image; determining a pupil-iris contrast as a contrast between the representation of the pupil in the image and the representation of the iris in the image; on a condition that the pupil intensity is determined to meet an intensity condition, determining an intensity compensated exposure time which is different from the first exposure time, wherein the determination comprises: on a condition that the pupil intensity is determined to be above a first intensity threshold, determining an intensity compensated exposure time that is shorter than the first exposure time by a predetermined decrement, wherein the first intensity threshold is set such that intensities above the first intensity threshold indicates saturation; on a condition that the pupil intensity is determined to be below the first intensity threshold and above a second intensity condition threshold, determining an intensity compensated exposure time that is shorter than the first exposure time, wherein a quotient between the intensity compensated exposure time and the first exposure time is proportional to the quotient between the second intensity threshold and the pupil intensity; and further on a condition that the pupil-iris contrast is determined to meet a contrast condition, determining a contrast compensated exposure time which is different from the first exposure time; and setting a second exposure time as the shorter of any determined intensity compensated exposure time and any determined contrast compensated exposure time, wherein the second exposure time is for application to the image sensor when capturing a further image. on a condition that the pupil intensity is determined to be above a first intensity threshold, determining an intensity compensated exposure time that is shorter than the first exposure time by a predetermined decrement, wherein the first intensity threshold is set such that intensities above the first intensity threshold indicates saturation; on a condition that the pupil intensity is determined to be below the first intensity threshold and above a second intensity condition threshold, determining an intensity compensated exposure time that is shorter than the first exposure time, wherein a quotient between the intensity compensated exposure time and the first exposure time is proportional to the quotient between the second intensity threshold and the pupil intensity; and further on a condition that the pupil-iris contrast is determined to meet a contrast condition, determining a contrast compensated exposure time which is different from the first exposure time; and setting a second exposure time as the shorter of any determined intensity compensated exposure time and any determined contrast compensated exposure time, wherein the second exposure time is for application to the image sensor when capturing a further image.