Method for operating a pacemaker comprising the procedures of building a database of a cardiac cycle of a patient suffering from bundle branch block and artificially pacing a ventricle of the patient using the pacemaker according to anticipative atrioventricular (AV) delays in the database which are based on measured P-P intervals in the database.