Extremum-seeking control is a useful tool for the steady-state performance optimization of plants for which the dynamics and disturbance situation can be unknown. The case when steady-state plant outputs are constant received a lot of attention, however, in many applications time-varying outputs characterize plant performance. As a result, no static parameter-to-steady-state performance map can be obtained. In this work, an extremum-seeking control method is proposed that uses a so-called dynamic cost function to cope with these time-varying outputs. We show that, under appropriate conditions, the solutions of the extremum-seeking control scheme are uniformly ultimately bounded in view of bounded and time-varying external disturbances, and ...