Expire old events.

@param time current timestamp
@return the count following expiry
198540
public long expire(long time) {
    for (int logSize = (Long.SIZE - 1) - numberOfLeadingZeros(last); logSize >= 0; logSize--) {
      boolean live = false;
      for (int i = min_l(logSize); i < max_l(logSize); i++) {
        long end = boxes[i];
        if (end != MIN_VALUE) {
          if ((time - end) >= window) {
            total -= 1L << logSize;
            boxes[i] = MIN_VALUE;
          } else {
            live = true;
          }
        }
      }
      if (live) {
        last = 1L << logSize;
        return count();
      }
    }
    last = 0;
    return 0;
  }
516248
private void expireSessions(long timestamp) {
    // Iterate through registered sessions.
    for (RaftSession session : sessions.getSessions(primitiveId)) {
      if (session.isTimedOut(timestamp)) {
        log.debug("Session expired in {} milliseconds: {}", timestamp - session.getLastUpdated(), session);
        session = sessions.removeSession(session.sessionId());
        if (session != null) {
          session.expire();
          service.expire(session.sessionId());
        }
      }
    }
  }
210170
public static boolean isExpired(TemporalAt entity) {
    Date now = new Date();
    if (null == entity.getBeginAt()) return true;
    return entity.getBeginAt().after(now) || (null != entity.getEndAt() && !now.before(entity.getEndAt()));
  }
1306730
def expiration_time(self):
        
        logging_forgotten_time = configuration.behavior.login_forgotten_seconds

        if logging_forgotten_time <= 0:
            return None

        now = timezone.now()
        delta = now - self.modified
        time_remaining = logging_forgotten_time - delta.seconds

        return time_remaining
1371077
public static <T> Expiring<T> of(T... elements) {
		return of(Arrays.asList(checkNotNull(elements)));
	}
989844
public function expiresAfter($time)
    {
        $this->expiration = new \DateTime();
        if (is_int($time)) {
            if ($time < 0) {
                $time = new \DateInterval('PT' . abs($time) . 'S');
                $time->invert = 1;
            } else {
                $time = new \DateInterval('PT' . $time . 'S');
            }
        }
        $this->expiration->add($time);
        $this->changed = true;
        return $this;
    }
58363
def expire(self, current_time=None):
        
        if not self._queue:
            return

        if current_time is None:
            current_time = time()

        while self._queue:
            # Get top most item
            top = self._queue[0]

            # Early exit if item was not promoted and its expiration time
            # is greater than now.
            if top.promoted is None and top.expiry_date > current_time:
                break

            # Pop item from the stack
            top = heappop(self._queue)

            need_reschedule = (top.promoted is not None
                               and top.promoted > current_time)

            # Give chance to reschedule
            if not need_reschedule:
                top.promoted = None
                top.on_delete(False)

                need_reschedule = (top.promoted is not None
                                   and top.promoted > current_time)

            # If item is promoted and expiration time somewhere in future
            # just reschedule it
            if need_reschedule:
                top.expiry_date = top.promoted
                top.promoted = None
                heappush(self._queue, top)
            else:
                del self._items[top.session_id]
643012
public long timeout()
    {
        final long now = now();
        for (Entry<Timer, Long> entry : entries()) {
            final Timer timer = entry.getKey();
            final Long expiration = entry.getValue();

            if (timer.alive) {
                //  Live timer, lets return the timeout
                if (expiration - now > 0) {
                    return expiration - now;
                }
                else {
                    return 0;
                }
            }

            //  Remove it from the list of active timers.
            timers.remove(expiration, timer);
        }
        //  Wait forever as no timers are alive
        return -1;
    }
1121738
public void addExecutionTime(long time) {
		totalTime.increaseByLong(time);
		lastRequest.setValueAsLong(time);
		minTime.setValueIfLesserThanCurrentAsLong(time);
		maxTime.setValueIfGreaterThanCurrentAsLong(time);

	}
1132084
def expire_at(self, key, _time):
        
        return self._client.expireat(self.get_key(key), round(_time))
1316966
public function expiresAfter($time)
    {
        if ($time instanceof \DateInterval) {
            $time = (int) $time->format("%r%s");
        }

        $this->expiration = time() + $time;

        return $this;
    }
455063
@SuppressWarnings("ShortCircuitBoolean")
  boolean hasExpired(Node<K, V> node, long now) {
    return (expiresAfterAccess() && (now - node.getAccessTime() >= expiresAfterAccessNanos()))
        | (expiresAfterWrite() && (now - node.getWriteTime() >= expiresAfterWriteNanos()))
        | (expiresVariable() && (now - node.getVariableTime() >= 0));
  }
178185
public void processExpires() {

    long timeNow = System.currentTimeMillis();
    InternalSession sessions[] = findSessions();
    int expireHere = 0 ;

    if(log.isDebugEnabled())
      log.debug("Start expire sessions {} at {} sessioncount {}", getName(), timeNow, sessions.length);
    for (int i = 0; i < sessions.length; i++) {
      if (sessions[i]!=null && !sessions[i].isValid()) {
        expireHere++;
      }
    }
    long timeEnd = System.currentTimeMillis();
    if(log.isDebugEnabled())
      log.debug("End expire sessions {} processingTime {} expired sessions: {}", getName(), timeEnd - timeNow, expireHere);
    processingTime += ( timeEnd - timeNow );

  }
825350
public function setExpireTime(int $time) : bool
        {
                return $this->_redis->expireat($this->_key, $time) > 0 ? true : false;
        }
765804
public Date getExpireDate() {
		Date ret = null;
		if (track2 != null) {
			ret = track2.getExpireDate();
		}
		if (ret == null && track1 != null) {
			ret = track1.getExpireDate();
		}
		return ret;
	}
962598
@Override
    public final void expirerStop()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "expirerStop");

        _expirer.stop();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "expirerStop");
    }
1092748
private void timeoutHasExpired(final Timeout timeout, final TimeoutExpirationContext context) {
        try {
            addMessage(timeout, context.getOriginalHeaders());
        } catch (Exception ex) {
            LOG.error("Error handling timeout {}", timeout, ex);
        }
    }