a method of controlling a power supply comprising a switch and an inductive device includes turning the switch on to energize the inductive device , detecting inductor current flowing through the inductive device to generate a current sensing signal , comparing a peak of the current sensing signal and a limiting signal to generate an adjustment value , and comparing the current sensing signal and the limiting signal . the switch is closed when the current sensing signal , the limiting signal , and the adjustment value are approximately in a specific relationship for approximately equalizing a next peak of the current sensing signal to the limiting signal to cancel signal delay influence .