Heartbeat time is incorrect if something signals the thread: Change to wait until time If times out then add x seconds to time else wait until time