Estimating Lifetimes of UV-selected Massive Galaxies at 0.5 ≤ z ≤ 2.5 in the COSMOS/UltraVISTA Field through Clustering Analyses