HeartBeatTimer doesn't work

Hello everyone,
I have to measure the time spent on a page when user has focus on it.
I saw that enableHeartBeatTimer functionality can measure this time, but it’s not working in my situation.

As documentation says, I wrote this code in my site:
_paq.push([‘enableHeartBeatTimer’,BeatTimerTimeout]), where BeatTimerTimeout is the delay of ping request.

This functionality (enableHeartBeatTimer) doesn’t seem to have any effect in my situation. Using enableHeartBeatTimer, the time spent by visitor is always the same: time spent when the user enter in the page until leaves it (without consider the focus of the user on this page).

I can see heartbeat request in traffic network, so I suppose that enableHeartBeatTimer functionality is correctly enabled, but when I test it I don’t have the result expected: if you stay actively in the page or if you aren’t the time calculated is the same.

Do you have any suggestions to solve my problem?
Can someone help me to solve this issue?

Thank you,
Federica