Yes the new Samsung Galaxy S5 has a unique feature of measuring user's heart rate.
How to measure the heart rate using S5?
Just place your finger on the sensor on the back of the smartphone. You will need to keep your finger still for a few seconds. The sensor will detect and report the heart rate within a few seconds.
How does this technology work?
Firstly the way S5 measures the heart rate is different from the way the standard heart rate monitors work(they work by recording the electrical activity of heart via skin - the same way an ECG or EKG machine does). On the contrary S5 measures the heart rate via using a light to check the flow of blood under the skin. Depending on the pattern of blood flow (e.g: peaks & valleys) it measures the heart rate.
Can you rely on this reported heart rate?
The company claims that the results are fairly accurate for casual usage, As this not the professional method of measuring heart rate so it is not recommended for purposes other than casual usage.
I hope that answers your question.