A camera, in particular 3D time-of-flight camera, for acquiring three-dimensional image data from a detection area, comprising an illumination unit for transmitting transmitted light into the detection area, the transmitted light being modulated with at least a first modulation frequency, an image sensor for receiving received light from the detection area, the image sensor comprising a plurality of receiving elements for generating a respective received signal, a plurality of demodulation units for demodulating the received signals at the first modulation frequency to obtain sample values, a reference illumination unit for transmitting reference light modulated at the first modulation frequency and guided within the camera onto the image sensor, and a control and evaluation unit configured, for a distance measurement, to control the illumination unit and/or the demodulation units for a first number of partial measurements with a respective different phase offset between the first modulation frequency for the transmitted light and the first modulation frequency for the demodulation, and to determine a distance value from the sample values obtained by the partial measurements per receiving element, and, for a function test, to control the reference illumination unit and/or the demodulation units for a second number of reference partial measurements with a respective different phase offset between the first modulation frequency for the reference light and the first modulation frequency for the demodulation, and to determine a reference distance value from the sample values obtained by the reference partial measurements per receiving element, characterized in that the control and evaluation unit is further configured to distribute the reference partial measurements for a function test over a plurality of distance measurements. an illumination unit for transmitting transmitted light into the detection area, the transmitted light being modulated with at least a first modulation frequency, an image sensor for receiving received light from the detection area, the image sensor comprising a plurality of receiving elements for generating a respective received signal, a plurality of demodulation units for demodulating the received signals at the first modulation frequency to obtain sample values, a reference illumination unit for transmitting reference light modulated at the first modulation frequency and guided within the camera onto the image sensor, and a control and evaluation unit configured, for a distance measurement, to control the illumination unit and/or the demodulation units for a first number of partial measurements with a respective different phase offset between the first modulation frequency for the transmitted light and the first modulation frequency for the demodulation, and to determine a distance value from the sample values obtained by the partial measurements per receiving element, and, for a function test, to control the reference illumination unit and/or the demodulation units for a second number of reference partial measurements with a respective different phase offset between the first modulation frequency for the reference light and the first modulation frequency for the demodulation, and to determine a reference distance value from the sample values obtained by the reference partial measurements per receiving element, characterized in that the control and evaluation unit is further configured to distribute the reference partial measurements for a function test over a plurality of distance measurements.