The electrocardiogram records the electrical functioning of the heart during its relaxation-contraction cycle. Since the heart is a muscle, it needs electrical stimulation to contract. These electrical impulses spread from the stimulation node of the atrium to the entire heart muscle and are in a way a reflection of the electrical functioning of the heart.