ECG is used to measure the rate and regularity of heartbeats, the size and position of the chambers, the presence of any damage to the heart, and the effects of drugs or devices used to regulate the heart, such as an artificial pacemaker.