This is an IR proximity sensor, not a time-of-flight sensor. It basically shoots out an IR cone and measures how much light is backscattered. While this works for presence detection, it is not suitable for ranging.
2 mm range resolution is very tough ask for a time-of-flight light sensor. Think about it: the speed of light is \$3 \times 10^8\ m/s\$. Range resolution for an unmodulated pulsed TOF laser system is given as \$\Delta R = c\frac{\Delta t}{2}\$, where \$ \Delta t\$ is the pusle length. If you do the math, you find that for 2 mm range resolution, you need \$t=26\ ps\$. That's not realistic, especially for a low-cost commodity TOF system.
I'd suggest looking at non-TOF approaches, if possible. Off the top of my head:
- Free-space ultrasound can meet the sort of resolution requirements you require, although clutter rejection may be a pain if the operating environment changes. You also may need to calibrate for air pressure, temperature, and humidity.
- Computer vision could work very well, especially if the system geometry allows setting up a camera looking at the scene in profile.
- Thinking really outside the box, what about interferometric radar? Even mmWave radar will not get the range resolution you want (COTS solutions do ~4 GHz bandwidth which corresponds to a range resolution of a few centimeters), but if you looked at the phase of the return pulse, you might be able to subdivide the resolution cell.