A switch controller compensates the total on-time delay of the switch in a
switching power converter. The intended on-time of the switching
transistor for the present switching cycle is reduced by the time
difference between the actual on-time and the intended on-time of the
switching transistor in the previous switching cycle in the switching
power converter. The total delay of the switch in the switching power
converter, including propagation delay, switch turn-on delay, and switch
turn-off delay, can be compensated in real time, cycle by cycle.