How to use heartbeat timers