A cardiac pacemaker has a pulse generator for delivering stimulation pulses to
a patient's heart and a control unit for controlling the delivery of the stimulation
pulses from the pulse generator. The control unit includes an altering unit for
altering the AV-delay value from a predetermined first AV-delay value to a predetermined
second AV-delay value, and back to the first AV-delay value. A sensor measures
a parameter related to cardiac output of the patient, the sensor measuring this
parameter in a time window within a time of operation with the first AV-delay value,
and in a time window within the time of operation with said second AV-delay value,
and in a time window within the time of operation after the return back to the
first AV-delay value. A calculation unit calculates respective average values of
the parameter during each of the time windows, and a determining unit determines
from these average values which of the AV-delay values results in a higher cardiac output.