A heart rate detection method and an apparatus, where the method is applied to an electronic device, and the electronic device includes a heart rate sensor. The method includes detecting, by the electronic device, a current motion status of a user carrying the electronic device, determining, based on a prestored correspondence between a motion status, a startup period, and a sampling rate, a startup period and a sampling rate corresponding to the current motion status, where the startup period is a period in which the heart rate sensor is started to detect a heart rate of the user carrying the electronic device, and the sampling rate is a sampling rate of collecting heart rate data by the heart rate sensor, and starting the heart rate sensor at regular intervals based on the startup period to collect heart rate data at the sampling rate.