A device includes a hemodynamic sensor measuring blood flow in the left chambers of a myocardium, at least one motion sensor measuring a displacement of the walls of the left ventricle of the myocardium, a first analysis module determining a time of closure of the aortic valve based on a signal of the hemodynamic sensor, a second analysis module determining a time of peak contraction of the left ventricle based on a signal from the motion sensors, and a third analysis module determining a time between the moment of peak contraction of the left ventricle and the moment of closure of the aortic valve. If the peak of contraction of the left ventricle is after the instant of closure of the aortic valve, the device adjusts the inter-ventricular delay and/or the atrioventricular delay to minimize or cancel the time disparity.