// AddElapsed just adds an elapsed time to the value that's been stored.
973366
func (s *Stopwatch) AddElapsedSince(t time.Time) {
	s.Lock()
	defer s.Unlock()

	s.elapsedTime += time.Since(t)
}
1185013
func (b *RWSetBuilder) AddToReadSet(ns string, key string, version *version.Height) {
	nsPubRwBuilder := b.getOrCreateNsPubRwBuilder(ns)
	nsPubRwBuilder.readMap[key] = NewKVRead(key, version)
}
1140385
func (s *RestoreStatus) SetElapsedTimeInSeconds(v int64) *RestoreStatus {
	s.ElapsedTimeInSeconds = &v
	return s
}
1074547
func (tx *Tx) bargeTimeElapsed() bool {
	return time.Now().Sub(tx.startTime) > bargeWaitNanos
}
556060
func (c *ExpirationCache) Add(obj interface{}) error {
	key, err := c.keyFunc(obj)
	if err != nil {
		return KeyError{obj, err}
	}
	c.cacheStorage.Add(key, &timestampedEntry{obj, c.clock.Now()})
	return nil
}
34799
func (fc *FakeClock) Add(d time.Duration) {
	fc.Lock()
	// Calculate the final time.
	end := fc.now.Add(d)
	fc.flush(end)

	if fc.now.Before(end) {
		fc.now = end
	}
	fc.Unlock()
	nap()
}
1009069
func addtimerLocked(t *Timer) {
	// when must never be negative; otherwise timerproc will overflow
	// during its delta calculation and never expire other runtime·timers.
	if t.when < 0 {
		t.when = 1<<63 - 1
	}
	t.i = len(timers.t)
	timers.t = append(timers.t, t)
	siftupTimer(t.i)
	if t.i == 0 {
		// siftup moved to top: new earliest deadline.
		if timers.sleeping {
			timers.sleeping = false
			select {
			case timers.sleep <- timers.sleeping:
			default:
			}
		}
		/*
			if timers.rescheduling {
				timers.rescheduling = false
				select {
				case timers.reschedule <- timers.rescheduling:
				default:
				}
			}
		*/
	}
	if !timers.created {
		timers.created = true
		timers.sleep = make(chan bool, 1)
		timers.reschedule = make(chan bool, 1)
		timers.T = time.NewTimer(time.Duration(t.when - Nanotime()))
		go timerproc()
	}
}
975565
func (ns *NamedStopwatch) AddElapsedSince(name string, t time.Time) {
	if ns == nil {
		return
	}
	ns.Lock()
	defer ns.Unlock()

	if s, ok := ns.stopwatches[name]; ok {
		s.AddElapsedSince(t)
	}
}
992863
func (d Duration) Add(v Duration) (Duration, error) {
	if &v == nil {
		return d, nil
	}
	dsum, err := AddInt64(int64(d.Duration), int64(v.Duration))
	if err != nil {
		return Duration{}, errors.Trace(err)
	}
	if d.Fsp >= v.Fsp {
		return Duration{Duration: gotime.Duration(dsum), Fsp: d.Fsp}, nil
	}
	return Duration{Duration: gotime.Duration(dsum), Fsp: v.Fsp}, nil
}
941143
func (c *Cache) LockedModify(u interface{}, add func(a, b interface{}) interface{}, increment interface{}) (interface{}, error) {

	var timer *time.Timer
	if c.lifetime != -1 {
		timer = time.AfterFunc(c.lifetime, func() {
			if err := c.removeNotify(u, true); err != nil {
				zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
			}
		})
	}

	t := time.Now()

	c.Lock()
	defer c.Unlock()

	e, ok := c.data[u]
	if !ok {
		return nil, errors.New("not found")
	}

	if e.timer != nil {
		e.timer.Stop()
	}

	e.value = add(e.value, increment)
	e.timer = timer
	e.timestamp = t
	e.expirer = c.expirer

	c.data[u] = e

	return e.value, nil

}
856981
func (b *Bar) PrependElapsed() *Bar {
	b.PrependFunc(func(b *Bar) string {
		return strutil.PadLeft(b.TimeElapsedString(), 5, ' ')
	})
	return b
}
1265103
func NewElapse(ctx *middleware.Context, handler ElapseHandler) *Elapse {
	return &Elapse{Context: ctx, Handler: handler}
}
963804
func (lib *Lib) AddCred(inputCredHandle *CredId,
	desiredName *Name, desiredMech *OID, credUsage CredUsage,
	initiatorTimeReq time.Duration, acceptorTimeReq time.Duration) (
	outputCredHandle *CredId, actualMechs *OIDSet,
	initiatorTimeRec time.Duration, acceptorTimeRec time.Duration,
	err error) {

	min := C.OM_uint32(0)
	actualMechs = lib.NewOIDSet()
	outputCredHandle = lib.NewCredId()
	initSeconds := C.OM_uint32(0)
	acceptSeconds := C.OM_uint32(0)

	maj := C.wrap_gss_add_cred(lib.Fp_gss_add_cred,
		&min,
		inputCredHandle.C_gss_cred_id_t,
		desiredName.C_gss_name_t,
		desiredMech.C_gss_OID,
		C.gss_cred_usage_t(credUsage),
		C.OM_uint32(initiatorTimeReq.Seconds()),
		C.OM_uint32(acceptorTimeReq.Seconds()),
		&outputCredHandle.C_gss_cred_id_t,
		&actualMechs.C_gss_OID_set,
		&initSeconds,
		&acceptSeconds)

	err = lib.stashLastStatus(maj, min)
	if err != nil {
		return nil, nil, 0, 0, err
	}

	return outputCredHandle,
		actualMechs,
		time.Duration(initSeconds) * time.Second,
		time.Duration(acceptSeconds) * time.Second,
		nil
}
311836
func (q *RateLimitedTimedQueue) Add(value string, uid interface{}) bool {
	now := now()
	return q.queue.Add(TimedValue{
		Value:     value,
		UID:       uid,
		AddedAt:   now,
		ProcessAt: now,
	})
}
130052
func (q *rateLimitingType) AddRateLimited(item interface{}) {
	q.DelayingInterface.AddAfter(item, q.rateLimiter.When(item))
}
680879
func (cd *CounterDuration) Add(delta time.Duration) {
	cd.i.Add(delta)
}
1245426
func (p *Pool) AddRefreshable(ctx context.Context, r Refreshable) {
	id, err := p.lock.Lock()
	if err == nil {
		defer p.lock.Unlock(id)
		p.refreshables = append(p.refreshables, r)
		r.Refresh(ctx)
	}
}