Time-resolved spectroscopy of charge-carrier dynamics in metal halide perovskites and other semiconductors for photovoltaics