this change provides for checking the heartbeat timout without any additional delays caused by fixed checking intervals. The basic idea is to not only store that there was some activity within the last heartbeatTimeout interval but to store also the timestamp of that activity. This timestamp can then be used to set a timer exactly to the remaining time span between the last activity and the expected heartbeat timeout.
this change provides for checking the heartbeat timout without any additional delays caused by fixed checking intervals. The basic idea is to not only store that there was some activity within the last heartbeatTimeout interval but to store also the timestamp of that activity. This timestamp can then be used to set a timer exactly to the remaining time span between the last activity and the expected heartbeat timeout.