This can be done by absolute dating technique. In this, the amount of radioactive material with a known half-life is measured. The measure of the radioactive decay of the elements present in the rock helps in the back calculation of the age of the rock. For older rocks, isotopes of Beryllium, Uranium, Argon etc. are used.