The lifetime of non-equilibrium electrons and holes in semiconductors is crucial for solar cell and optoelectronic applications. Non-adiabatic molecular dynamics (NAMD) simulations based on time-dependent density functional theory (TDDFT) are widely used to study excited-state carrier dynamics. However, the calculated carrier lifetimes are often different from experimental results by orders of magnitude. In this work, by revisiting the definition of carrier lifetime and considering different recombination mechanisms, we report a systematic procedure for calculating the effective carrier lifetime in realistic semiconductor crystals that can be compared directly to experimental measurements. The procedure shows that considering all recombination mechanisms and using reasonable densities of carriers and defects are crucial in calculating the effective lifetime. When NAMD simulations consider only Shockey-Read-Hall (SRH) defect-assisted and band-to-band non-radiative recombination while neglect band-to-band radiative recombination, and the densities of non-equilibrium carriers and defects in supercell simulations are much higher than those in realistic semiconductors under solar illumination, the calculated lifetimes are ineffective and thus differ from experiments. Using our procedure, the calculated effective lifetime of the halide perovskite CH3NH3PbI3 agrees with experiments. It is mainly determined by band-to-band radiative and defect-assisted non-radiative recombination, while band-to-band non-radiative recombination is negligible. These results indicate that it is possible to calculate carrier lifetimes accurately based on NAMD simulations, but the directly calculated values should be converted to effective lifetimes for comparison to experiments. The revised procedure can be widely applied in future carrier lifetime simulations.