The present invention relates to the field of sports equipment. Disclosed are a method for measuring heart rate and a bicycle. The method comprises: recording a heart rate range corresponding to different exercise objectives at various age ranges (S101); reading an age and an exercise objective of a user, and displaying a corresponding heart rate range (S102); continuing to monitor and display the current heart rate, and determining whether the heart rate is within the heart rate range (S103); if so, then remaining as is (S104); and if not, then flashing and displaying the current heart rate (S105). The method for measuring heart rate and the bicycle uses an electrode provided on a left handlebar or right handlebar to acquire an electrocardiogram signal from the human body and to monitor, on a real-time basis, a heart rate of a user when riding a bicycle. The method also reads an age and exercise objective of the user to obtain a corresponding heart rate range, performs a comparison with a real-time heart rate, and provides a display on the liquid crystal display screen at the middle of a bicycle handlebar so as to achieve an instructing and prompting function.