An electrocardiogram, or EKG, is a common test performed to measure the electrical activity of the heart. The heart muscle uses electricity to move and contract, and an EKG measures those electric signals. It is non-invasive, usually quick, and painless. It does not send any electricity into the body; it only measures what is there.
To perform an EKG, small sticky patches connected to wires called electrodes must be placed at various points over the chest, arms, and legs. It looks funny, but it doesn't hurt. Then you simply lie on a table for about 10 minutes while the electrodes take measurements. Some kinds of EKGs take measurements while you walk or ride a stationary bicycle, in order to see how exercise affects the heart. After the required information is gathered, the electrodes are removed.
An EKG can tell a doctor a great deal about how the heart is working and how healthy the muscle is. It is often used to diagnose a heart attack, but it can also be used to look for evidence of irregular heart rhythms, weakness in the heart muscle, or valve problems.