src/main/java/org/beykery/jkcp/Kcp.java
public long check(long current) {
        long cur = current;
        if (updated == 0) {
            return cur;
        }
        long ts_flush_temp = this.ts_flush;
        long tm_packet = 0x7fffffff;
        if (_itimediff(cur, ts_flush_temp) >= 10000 || _itimediff(cur, ts_flush_temp) < -10000) {
            ts_flush_temp = cur;
        }
        if (_itimediff(cur, ts_flush_temp) >= 0) {
            return cur;
        }
        long tm_flush = _itimediff(ts_flush_temp, cur);
        for (Segment seg : snd_buf) {
            long diff = _itimediff(seg.resendts, cur);
            if (diff <= 0) {
                return cur;
            }
            if (diff < tm_packet) {
                tm_packet = diff;
            }
        }
        long minimal = tm_packet < tm_flush ? tm_packet : tm_flush;
        if (minimal >= interval) {
            minimal = interval;
        }
        return cur + minimal;
    }
/**
     * Determine when should you invoke ikcp_update: returns when you should
     * invoke ikcp_update in millisec, if there is no ikcp_input/_send calling.
     * you can call ikcp_update in that time, instead of call update repeatly.
     * Important to reduce unnacessary ikcp_update invoking. use it to schedule
     * ikcp_update (eg. implementing an epoll-like mechanism, or optimize
     * ikcp_update when handling massive kcp connections)
     *
     * @param current
     * @return
     */
Determine when should you invoke ikcp_update: returns when you should
invoke ikcp_update in millisec, if there is no ikcp_input/_send calling.
you can call ikcp_update in that time, instead of call update repeatly.
Important to reduce unnacessary ikcp_update invoking. use it to schedule
ikcp_update

@param current
@return
Determine when should you invoke ikcp_update : returns when you should invoke ikcp_update in millisec if there is no ikcp_input / _send calling . you can call ikcp_update in that time instead of call update repeatly . Important to reduce unnacessary ikcp_update invoking . use it to schedule ikcp_update @param current @return
public long check(long current) {
        long cur = current;
        if (updated == 0) {
            return cur;
        }
        long ts_flush_temp = this.ts_flush;
        long tm_packet = 0x7fffffff;
        if (_itimediff(cur, ts_flush_temp) >= 10000 || _itimediff(cur, ts_flush_temp) < -10000) {
            ts_flush_temp = cur;
        }
        if (_itimediff(cur, ts_flush_temp) >= 0) {
            return cur;
        }
        long tm_flush = _itimediff(ts_flush_temp, cur);
        for (Segment seg : snd_buf) {
            long diff = _itimediff(seg.resendts, cur);
            if (diff <= 0) {
                return cur;
            }
            if (diff < tm_packet) {
                tm_packet = diff;
            }
        }
        long minimal = tm_packet < tm_flush ? tm_packet : tm_flush;
        if (minimal >= interval) {
            minimal = interval;
        }
        return cur + minimal;
    }
public long check ( long current ) { long cur = current ; if ( updated == 0 ) { return cur ; } long ts_flush_temp = this . ts_flush ; long tm_packet = 0x7fffffff ; if ( _itimediff ( cur , ts_flush_temp ) >= 10000 || _itimediff ( cur , ts_flush_temp ) < - 10000 ) { ts_flush_temp = cur ; } if ( _itimediff ( cur , ts_flush_temp ) >= 0 ) { return cur ; } long tm_flush = _itimediff ( ts_flush_temp , cur ) ; for ( Segment seg : snd_buf ) { long diff = _itimediff ( seg . resendts , cur ) ; if ( diff <= 0 ) { return cur ; } if ( diff < tm_packet ) { tm_packet = diff ; } } long minimal = tm_packet < tm_flush ? tm_packet : tm_flush ; if ( minimal >= interval ) { minimal = interval ; } return cur + minimal ; }
Determine when should you invoke ikcp_update: returns when you should
 invoke ikcp_update in millisec, if there is no ikcp_input/_send calling.
Determine when should you invoke ikcp_update : returns when you should invoke ikcp_update in millisec if there is no ikcp_input / _send calling .