class Heartbeat {

    public long timeToNextHeartbeat(long now) {
        // 现在距离最后一次心跳
        long timeSinceLastHeartbeat = now - Math.max(lastHeartbeatSend, lastSessionReset);

        if (timeSinceLastHeartbeat > interval)
            return 0;
        else
            return interval - timeSinceLastHeartbeat;
    }

    public  Heartbeat(long timeout,
                     long interval,
                     long now);

}