It is the difference between the heartbeat which sensed by the pulse sensor.
What is?
You are completely, apparently, confusing a heart beat, a discrete event, and a heart rate - the number of discrete events in some period of time.
I delay the display of heartbeat to 1 second
You do not delay anything. You periodically display the RATE (NOT an event) once per second.
but arduino find the difference between the heartbeat in 2ms.
Do you have ANY idea what a heartbeat looks like? Earlier, I referred to it as a discrete event, but it is really a complex series of contractions of the muscles in the heart. What you would see on a scope, on an EKG machine, is something that looks vaguely like a sine wave. The curve is continuous, with peaks and valleys. Since the Arduino needs to be doing other things, it can't look at the signal continuously. The best it can do is look at the signal periodically (with 2 milliseconds being the period).
It looks at the signal that often so that it can detect when a peak occurs. When the value of the signal, at some point in time, is more that the value last time, the value has NOT reached a peak. So, the Arduino goes off and does other stuff.
Two milliseconds later, it looks again. This time, maybe the signal is the same as last time, so the signal is either at a peak or at a trough. So, the Arduino goes off and does other stuff.
Two milliseconds later, it looks again. This time, maybe the signal is less than last time, so last time's value WAS a peak. The Arduino then notes that a peak has occurred (ONE heartbeat has happened).
Part of what the Arduino does when it goes away is to determine if it is time to report the number of beats (the number of discrete events) that have happened in some period of time, extrapolated to a more normal unit of time. That is, it calculates that 19 beats have occurred in the last 15 seconds, to that corresponds to 76 beats in 60 seconds.
The Arduino is NOT "find the difference between the heartbeat in 2ms.". That doesn't even make sense.