An electronic device includes a first power supply unit, a second power supply unit, and a control circuit. The control circuit connected between the first power supply unit and the second power supply unit is configured for detecting an output power of the first power supply unit, and comparing the output power with a rated power of the first power supply unit. When the output power exceeds the rated power of the first power supply unit, the control circuit allows the second power supply unit to power the electronic device.