Laser Doppler perfusion monitoring (LDPM) is an established method for microvascular measurements. When applied to the beating heart, however, movement artifact contributions will result in an overestimation of the perfusion. In order to overcome this problem, the perfusion signal may be processed in relation to intervals in the cardiac cycle with minimal tissue motion, e.g., in late systole and late diastole. The aim of this study was to develop an electrocardiogram (ECG) tracing algorithm for R, T and P wave detection and to use these peaks to process the perfusion in intervals with minimal motion. The algorithm, evaluated in three subjects, detected the peaks correctly to 99.9% under ideal conditions. Used on a heart patient in postoperative care this was reduced to 93.2%. However, since the overall goal is to monitor changes in the myocardial perfusion over hours or even days, it is not necessary to capture perfusion values in every single heartbeat. Time traces of perfusion captured in relation to the T and P waves showed a periodical behavior. In order to tune the processing and presentation of the perfusion signal, future studies will focus on long term monitoring of myocardial perfusion during heart surgery and in the postoperative care.