In a method of preventing the formation of alternans in the heart of a patient, the heart is paced to control the TR interval of each heartbeat. The method may be performed using a heart monitoring and pacing device that includes a processor, memory, an electrocardiogram (ECG) sensing circuit, and a pulse generator. In the method, a heartbeat rate of the heart is detected and comparted to a threshold value stored in the memory. The heart is paced using the pulse generator to force the TR period of a limited number of heartbeats toward a targeted TR period, which is stored in the memory.