How does ToF camera measure the distance?

ToF camera is small in size, which is very suitable for some application scenarios that require lightness and small size. So how does the ToF camera perform distance measurement?
ToF camera measurement principle

Emitted infrared light is reflected by the object to be measured and then returns to the sensor. The built-in timer records the back and forth time, and then the distance can be calculated. It sounds like it's no different from the ultrasonic ranging. But it is not the case. Ultrasonic distance measurement requires relatively high requirements for reflective objects. Objects with small areas such as lines and cones cannot be detected. ToF sensor infrared distance measurement can completely overcome this problem. At the same time, the ToF camera has high ranging accuracy. Long range measurement and fast response. This technology is basically similar to the principle of the 3D laser sensor, except that the 3D laser sensor scans point by point, while the ToF camera obtains the depth information of the entire image at the same time.

 ToF camera measure distance