Calculating BPM based on input pulse

is that you are using "delay()" in your code.

The "delay()" function does just that - delays all operations for a given time, during which you cannot respond to inputs. It is for crude "demonstration" code only, or to insert necessary brief pauses in data output such as when initialising an LCD display. It has no place in a program which is seeking input.

Well, at least you were not proposing to use interrupts, which would make matters immensely worse (at least in this instance). "delay()" plus interrupts is a really bad mix!

I could have some more constructive advice but - half your code appears to be missing!

Your use of software serial would appear to be quite unnecessary - if the display uses 9600 baud, so does the serial monitor of the IDE so you can simply connect the display to the TX (I think it is) line on the Arduino board and use the hardware serial.

I suggest you should be trying not to count the beats in a 20 second interval, which for an approximately 60 BPM figure will give a synchronisation jitter of 1 in 20 or 5% - ±3 beats, but to start on a beat, count for 20 seconds and then measure the time on the next beat and make your calculation on the actual time and the number of beats counted. This does of course require calculation but this can be performed with integer mathematics - you absolutely do not need floating point. And in fact, it would work just as well for a ten second integration period.

Now you do have a problem if as it seems you are trying to do, you wish to give a continuous output on the display. One part of the problem is that you are actually introducing another "delay". This will probably not be a problem if as I have described, you synchronise your cycle to the actual detected beats (and you need a "debounce" routine with something like 100 ms integration as part of the beat detection - "integration" means that you repeatedly check that the pulse input has not changed at any time in the integration interval) then you can perform the time-consuming display immediately after the beat is detected, knowing that nothing else will happen for a reasonable time.

The ultimate development of the program (which turns out to be dead simple), is to use a FIFO array to keep the running intervals of the last ten beats and after each beat, use that to calculate and display the averaged BPM.