A method for sensing current independently of variations in operating
conditions is provided that includes generating a switch signal at a
switching element. A reference signal is generated at a reference signal
generator that is operable to track the switching element. A sense signal
is generated based on the switch signal. An output current of the
switching element is sensed based on a difference between the reference
signal and the sense signal.