A controller for a power converter, the power converter comprising a converter-switch and a converter-inductor, the controller comprising: a sensed-input-terminal configured to receive a sensed-signal that is representative of operation of the power converter; a reference-input-terminal configured to receive a reference-signal; a controller-output-terminal configured to provide a switch-control-signal for the converter-switch; a comparator configured to provide a comparator-output-signal that has a comparator-output-state dependent on whether or not the sensed-signal is greater than the reference-signal, wherein the comparator-output-state can take a first-state-value or a second-state-value; characterized by: a delay-block configured to: set a time-delay-value based on: (i) a voltage across the converter-inductor and (ii) a timing constant; start a timer when the comparator-output-state changes; and cause a change in the switch-control-signal when the timer reaches the time-delay-value; wherein the delay-block comprises a calibration-block configured to: determine an up-down-count-value, which is representative of a difference between, for a complete switching cycle: (a) a length of time that the comparator-output-signal has the first-state-value, and (b) a length of time that the comparator-output-signal has the second-state-value; and modify the timing-constant based on the up-down-count-value. a sensed-input-terminal configured to receive a sensed-signal that is representative of operation of the power converter; a reference-input-terminal configured to receive a reference-signal; a controller-output-terminal configured to provide a switch-control-signal for the converter-switch; a comparator configured to provide a comparator-output-signal that has a comparator-output-state dependent on whether or not the sensed-signal is greater than the reference-signal, wherein the comparator-output-state can take a first-state-value or a second-state-value; a delay-block configured to: set a time-delay-value based on: (i) a voltage across the converter-inductor and (ii) a timing constant; start a timer when the comparator-output-state changes; and cause a change in the switch-control-signal when the timer reaches the time-delay-value; set a time-delay-value based on: (i) a voltage across the converter-inductor and (ii) a timing constant; start a timer when the comparator-output-state changes; and cause a change in the switch-control-signal when the timer reaches the time-delay-value; wherein the delay-block comprises a calibration-block configured to: determine an up-down-count-value, which is representative of a difference between, for a complete switching cycle: (a) a length of time that the comparator-output-signal has the first-state-value, and (b) a length of time that the comparator-output-signal has the second-state-value; and modify the timing-constant based on the up-down-count-value. determine an up-down-count-value, which is representative of a difference between, for a complete switching cycle: (a) a length of time that the comparator-output-signal has the first-state-value, and (b) a length of time that the comparator-output-signal has the second-state-value; and modify the timing-constant based on the up-down-count-value.