The spin relaxation time of electrons in GaAs and GaN are determined with a model that includes momentum scattering by phonons and ionized impurities, and spin scattering by the Elliot-Yafet, Dyakonov-Perel, and Bir-Aronov-Pikus mechanisms. Accurate bands generated using a long-range tight-binding Hamiltonian obtained from empirical pseudopotentials are used. The inferred temperature-dependence of the spin relaxation lifetime agrees well with measured values in GaAs. We further show that the spin lifetimes decrease rapidly with injected electrons energy and reach a local maximum at the longitudinal optical phonon energy. Our calculation predicts that electron spin lifetime in pure GaN is about 3 orders of magnitude longer than in GaAs at all temperatures, primarily as a result of the lower spin-orbit interaction and higher conduction band density of states.