Study of electron energy relaxation times in GaAs and InP