Displacement measurement in real time using the attenuated total reflection technique