A switched-mode power supply, comprising - input terminals (101, 102) for receiving an input voltage and/or an input current; - output terminals (103, 104) for providing an output voltage and/or an output current; - a circuit for current and/or voltage conversion arranged between the input and output terminals, with at least a first, second and third controllable switch, wherein the circuit comprises a first circuit part for power factor correction, a second circuit part downstream of the first circuit part in form of a DC-DC converter for generating a clocked voltage, and a third circuit part downstream of the second circuit part in form of a synchronous rectifier, and wherein the first circuit part includes the first controllable switch, the second circuit part includes the second controllable switch and the third circuit part includes the third controllable switch; - a control unit for controlling at least the first, second and third controllable switches using at least a first, second and third pulse width modulation signal with variable frequency and variable duty cycle, wherein the control unit is adapted for controlling the phase difference between the pulse width modulation signals for driving the first and the second switch and/or the phase difference between the pulse width modulation signals for driving the second and the third switch, and - measuring means (151, 141, 153, 143) connected to the control unit, which are at least adapted for measuring the input current, the input voltage, the output current, and the output voltage, wherein the control unit is adapted for monitoring the efficiency of the switched-mode power supply based on the measured values from the connected measuring means, and for optimizing the efficiency by means of a first digital control loop by driving the at least one controllable switch. - input terminals (101, 102) for receiving an input voltage and/or an input current; - output terminals (103, 104) for providing an output voltage and/or an output current; - a circuit for current and/or voltage conversion arranged between the input and output terminals, with at least a first, second and third controllable switch, wherein the circuit comprises a first circuit part for power factor correction, a second circuit part downstream of the first circuit part in form of a DC-DC converter for generating a clocked voltage, and a third circuit part downstream of the second circuit part in form of a synchronous rectifier, and wherein the first circuit part includes the first controllable switch, the second circuit part includes the second controllable switch and the third circuit part includes the third controllable switch; - a control unit for controlling at least the first, second and third controllable switches using at least a first, second and third pulse width modulation signal with variable frequency and variable duty cycle, wherein the control unit is adapted for controlling the phase difference between the pulse width modulation signals for driving the first and the second switch and/or the phase difference between the pulse width modulation signals for driving the second and the third switch, and - measuring means (151, 141, 153, 143) connected to the control unit, which are at least adapted for measuring the input current, the input voltage, the output current, and the output voltage, wherein the control unit is adapted for monitoring the efficiency of the switched-mode power supply based on the measured values from the connected measuring means, and for optimizing the efficiency by means of a first digital control loop by driving the at least one controllable switch.