A method for operating a single-photon avalanche diode SPAD detector, the SPAD detector comprising a pixel array that includes a reference sub-array of reference pixels and an imaging sub-array of imaging pixels, the method comprising: detecting a start time to enable an operation of an imaging SPAD in an imaging pixel in the imaging sub-array using a reference SPAD in a reference pixel in the reference sub-array; in response to detecting the start time, enabling the operation of the imaging SPAD such that the imaging SPAD is operable to detect photons; determining, for each detected photon, a respective time of flight; characterized by: constructing a non-uniform histogram based on a time of flight of each detected photon, wherein the non-uniform histogram comprises: a first bin having a first width, wherein the first bin represents a first count of photons having times of flight detected during a first range of times of flight; and a second bin having a second width different from the first width, wherein the second bin represents a second count of photons having times of flight detected during a second range of times of flight different from the first range of times of flight, the first bin providing the SPAD detector with a first sensitivity to photons and the second bin providing a second sensitivity to photons that is different from the first sensitivity, wherein the second sensitivity corresponds to a different resolution of times of flight than the first sensitivity. detecting a start time to enable an operation of an imaging SPAD in an imaging pixel in the imaging sub-array using a reference SPAD in a reference pixel in the reference sub-array; in response to detecting the start time, enabling the operation of the imaging SPAD such that the imaging SPAD is operable to detect photons; determining, for each detected photon, a respective time of flight; characterized by: constructing a non-uniform histogram based on a time of flight of each detected photon, wherein the non-uniform histogram comprises: a first bin having a first width, wherein the first bin represents a first count of photons having times of flight detected during a first range of times of flight; and a second bin having a second width different from the first width, wherein the second bin represents a second count of photons having times of flight detected during a second range of times of flight different from the first range of times of flight, the first bin providing the SPAD detector with a first sensitivity to photons and the second bin providing a second sensitivity to photons that is different from the first sensitivity, wherein the second sensitivity corresponds to a different resolution of times of flight than the first sensitivity. a first bin having a first width, wherein the first bin represents a first count of photons having times of flight detected during a first range of times of flight; and a second bin having a second width different from the first width, wherein the second bin represents a second count of photons having times of flight detected during a second range of times of flight different from the first range of times of flight, the first bin providing the SPAD detector with a first sensitivity to photons and the second bin providing a second sensitivity to photons that is different from the first sensitivity, wherein the second sensitivity corresponds to a different resolution of times of flight than the first sensitivity.