Electrocardiography is a transthoracic (across the thorax or chest) interpretation of the electrical
Electricity is a general term encompassing a variety of phenomena resulting from the presence and flow of electric charge. These include many easily recognizable phenomena, such as lightning, static electricity, and the flow of electrical current in an electrical wire...

 activity of the heart
The heart is a myogenic muscular organ found in all animals with a circulatory system , that is responsible for pumping blood throughout the blood vessels by repeated, rhythmic contractions...

 over a period of time, as detected by electrode
An electrode is an electrical conductor used to make contact with a nonmetallic part of a circuit...

s attached to the outer surface of the skin and recorded by a device external to the body. The recording produced by this noninvasive procedure is termed as electrocardiogram (also ECG or EKG). An electrocardiogram (ECG) is a test that records the electrical activity of the heart.

ECG is used to measure the rate and regularity of heartbeats as well as 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 a pacemaker
Artificial pacemaker
A pacemaker is a medical device that uses electrical impulses, delivered by electrodes contacting the heart muscles, to regulate the beating of the heart...