Device for measuring an environment, comprising: a housing, which has, on one side, a passage window made of a watertight and transparent material for the passage of a laser beam, a transmitter and a receiver for the laser beam, a deflection device arranged in the beam path of the laser beam, downstream of the transmitter and upstream of the receiver, for deflecting the laser beam, a measuring device connected to the deflection device for determining the respectively current deflection direction (α 1,i) of the laser beam, a processor connected to the transmitter, the receiver, and the measuring device and configured to measure, by means of time-of-flight measurements of the laser beam emitted in various directions (R i) and, thus, reflected at various scanning points (P i) of the environment, the distances (d i) of the scanning points in said directions (R i) and to generate, therefrom, a scanning point cloud of the environment in a coordinate system, and a sensor for determining the refractive index (n 3) of a medium (M 3) of the environment located outside the passage window, wherein the processor is also connected to the sensor and is configured to take into account the refractive index (n 3) determined by the sensor when measuring the distances (d i) and directions (R i) of the scanning points (P i), characterized in that the laser beam is pulsed by the transmitter with a pulse repetition rate that can be controlled by the processor, wherein the processor is configured to decrease the pulse repetition rate in case of a first, larger refractive index (n 3) determined by the sensor, and to increase it in case of a second, smaller refractive index (n 3) determined by the sensor. a housing, which has, on one side, a passage window made of a watertight and transparent material for the passage of a laser beam, a transmitter and a receiver for the laser beam, a deflection device arranged in the beam path of the laser beam, downstream of the transmitter and upstream of the receiver, for deflecting the laser beam, a measuring device connected to the deflection device for determining the respectively current deflection direction (α 1,i) of the laser beam, a processor connected to the transmitter, the receiver, and the measuring device and configured to measure, by means of time-of-flight measurements of the laser beam emitted in various directions (R i) and, thus, reflected at various scanning points (P i) of the environment, the distances (d i) of the scanning points in said directions (R i) and to generate, therefrom, a scanning point cloud of the environment in a coordinate system, and a sensor for determining the refractive index (n 3) of a medium (M 3) of the environment located outside the passage window, wherein the processor is also connected to the sensor and is configured to take into account the refractive index (n 3) determined by the sensor when measuring the distances (d i) and directions (R i) of the scanning points (P i), characterized in that the laser beam is pulsed by the transmitter with a pulse repetition rate that can be controlled by the processor, wherein the processor is configured to decrease the pulse repetition rate in case of a first, larger refractive index (n 3) determined by the sensor, and to increase it in case of a second, smaller refractive index (n 3) determined by the sensor.