Exporting serial data from Arduino in real time

I have an additional question:

What sensor could I use to detect the distance that the sensor itself traveled (in all 3 axis) down to the millimeter?

Thank you.