A theory of time-space coordinate transformation is presented for measuring space with time. A novel type of displacement sensor named time grating is developed, and methods of electronic rectifying, self-compensation and self-correction are proposed to intelligentize the sensor. Experiment results coming from applications conform to the validity of the proposed theory and methods. The experiment and test results show that high-precision measurement is achieved without high-precision manufacture and that angular displacement is measured very accurately without a dividing scale, which embeds the remarkable characteristics of low cost but high accuracy to the time grating sensor.