// Record the duration of an event that started at a time and ends now.
173975
func (t *StandardResettingTimer) UpdateSince(ts time.Time) {
	t.mutex.Lock()
	defer t.mutex.Unlock()
	t.values = append(t.values, int64(time.Since(ts)))
}
1355118
func (kl *Kubelet) recordNodeStatusEvent(eventType, event string) {
	klog.V(2).Infof("Recording %s event message for node %s", event, kl.nodeName)
	// TODO: This requires a transaction, either both node status is updated
	// and event is recorded or neither should happen, see issue #6055.
	kl.recorder.Eventf(kl.nodeRef, eventType, event, "Node %s status is now: %s", kl.nodeName, event)
}
32959
func (_m *Statter) TimingDuration(_a0 string, _a1 time.Duration, _a2 float32) error {
	ret := _m.Called(_a0, _a1, _a2)

	var r0 error
	if rf, ok := ret.Get(0).(func(string, time.Duration, float32) error); ok {
		r0 = rf(_a0, _a1, _a2)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
1372820
func (h *Histogram) RecordDuration(v time.Duration) error {
	return h.RecordIntScale(int64(v), -9)
}
686552
func recordDuration(start time.Time, name string, ctx *workflowContext) {
	elapsed := time.Since(start)
	ctx.transaction.stepDurations = append(ctx.transaction.stepDurations,
		&workflowStepDuration{
			name:     name,
			duration: elapsed,
		})
}
144676
func (RealClock) Timer(d time.Duration) Timer {
	return &realTimer{t: time.NewTimer(d)}
}
666655
func (t UnixTime) Duration() time.Duration {
	return time.Time(t).Sub(unixEpoch)
}
1244199
func (mmap MarshalMap) Duration(key string) (time.Duration, error) {
	val, exists := mmap.Value(key)
	if !exists {
		return time.Duration(0), fmt.Errorf(`"%s" is not set`, key)
	}

	switch val.(type) {
	case time.Duration:
		return val.(time.Duration), nil
	case string:
		return time.ParseDuration(val.(string))
	}

	return time.Duration(0), fmt.Errorf(`"%s" is expected to be a duration or string`, key)
}
742207
func Duration(key string, fallback time.Duration) time.Duration {
	return DefaultClient.Duration(key, fallback)
}
399007
func (k *Key) Duration() (time.Duration, error) {
	return time.ParseDuration(k.String())
}
831014
func Duration(input interface{}) (output time.Duration, err error) {
	switch castValue := input.(type) {
	case string:
		output, err = time.ParseDuration(castValue)
		if err != nil {
			outputInt, errCast := Int(castValue)
			if errCast != nil {
				err = NewCastError("Could not convert to time.Duration")
				return
			}
			output = time.Duration(int(outputInt))
		}
		return
	case time.Duration:
		output = castValue
		return
	default:
		outputInt, errCast := Int(castValue)
		if errCast == nil {
			output = time.Duration(int(outputInt))
			return
		}
		err = NewCastError("Could not convert to time.Duration")
	}
	return
}
123189
func (c *Distconf) Duration(key string, defaultVal time.Duration) *Duration {
	c.grabInfo(key)
	s := &durationConf{
		defaultVal: defaultVal,
		Duration: Duration{
			currentVal: defaultVal.Nanoseconds(),
		},
		logger: log.NewContext(c.Logger).With(logkey.DistconfKey, key),
	}
	// Note: in race conditions 's' may not be the thing actually returned
	ret, okCast := c.createOrGet(key, s).(*durationConf)
	if !okCast {
		c.Logger.Log(logkey.DistconfKey, key, "Registering key with multiple types!  FIX ME!!!!")
		return nil
	}
	return &ret.Duration
}
369774
func (c *Parser) Duration() (time.Duration, error) {
	if c == nil {
		return 0, errors.New("can't calculate the duration of a nil pointer")
	}
	if c.ID == [4]byte{} || c.AvgBytesPerSec == 0 {
		err := c.Parse()
		if err != nil {
			return 0, nil
		}
	}
	switch c.Format {
	case WavFormatID:
		return c.wavDuration()
	default:
		return 0, ErrFmtNotSupported
	}
}
673968
func (t *Timings) Record(name string, startTime time.Time) {
	t.Add(name, time.Now().Sub(startTime))
}
492062
func (t *Track) Duration() time.Duration {
	ms := C.sp_track_duration(t.sp_track)
	return time.Duration(ms) * time.Millisecond
}
774701
func (p *Peer) LastSend() time.Time {
	return time.Unix(atomic.LoadInt64(&p.lastSend), 0)
}
565002
func (d *Decoder) Duration() (time.Duration, error) {
	if d == nil {
		return 0, errors.New("can't calculate the duration of a nil pointer")
	}
	d.ReadInfo()
	if err := d.Err(); err != nil {
		return 0, err
	}
	duration := time.Duration(float64(d.NumSampleFrames) / float64(d.SampleRate) * float64(time.Second))
	return duration, nil
}