An electrocardiogram (ECG) records the electrical activity of the heart. Small metal electrodes are attached to the skin on the arms, legs, and chest to detect electrical impulses from the heart. The ECG machine amplifies and records these impulses, showing normal and abnormal heart rhythms and any signs of heart damage or disease. A normal ECG tracing shows the P wave, QRS complex, and T wave representing atrial and ventricular contractions and repolarizations. The ECG test takes about five minutes and is painless.