Code example for Delayed

Methods: getDelay

0
                else if (sequenceNumber < x.sequenceNumber)
                    return -1; 
                else 
                    return 1; 
            } 
            long diff = getDelay(TimeUnit.NANOSECONDS) - other.getDelay(TimeUnit.NANOSECONDS);
            return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
        } 
    } 
 
    static class DelayedValue2 extends DelayedValue { 
        public DelayedValue2(int value, long millis) {
            super(value, millis);
        } 
 
        @Override 
        public int compareTo(Delayed other) {
            if (other == this) // compare zero if same object
                return 0; 
            if (other instanceof DelayedValue2) {