// Duration returns the duration for the current attempt before incrementing
// the attempt counter. See ForAttempt.
487608
func (b *Backoff) Duration() time.Duration {
	d := b.ForAttempt(b.attempt)
	b.attempt++
	return d
}
1268189
func Duration(val interface{}) time.Duration {
	switch t := val.(type) {
	case int:
		return time.Duration(int64(t))
	case int8:
		return time.Duration(int64(t))
	case int16:
		return time.Duration(int64(t))
	case int32:
		return time.Duration(int64(t))
	case int64:
		return time.Duration(t)
	case uint:
		return time.Duration(int64(t))
	case uint8:
		return time.Duration(int64(t))
	case uint16:
		return time.Duration(int64(t))
	case uint32:
		return time.Duration(int64(t))
	case uint64:
		return time.Duration(int64(t))
	default:
		return strToDuration(String(val))
	}
	panic("Reached")
}
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
}
117863
func (t *Trace) Duration() time.Duration {
	if t.End.IsZero() {
		return -1
	}
	return t.End.Sub(t.Start)
}
1150039
func (r *Reader) Duration(name string) time.Duration {
	return r.DurationDefault(name, 0)
}
1233187
func (s *FullJitterStrategy) Calculate(attempt int) time.Duration {
	// lazily initialize the RNG
	s.rngOnce.Do(func() {
		if s.rng != nil {
			return
		}
		s.rng = rand.New(rand.NewSource(time.Now().UnixNano()))
	})

	backoffDuration := s.cfg.BackoffMultiplier *
		time.Duration(math.Pow(2, float64(attempt)))
	return time.Duration(s.rng.Intn(int(backoffDuration)))
}
1299731
func (c *Client) Time(stat string, rate float64, f func()) error {
	ts := time.Now()
	f()
	return c.Duration(stat, time.Since(ts), rate)
}
606209
func (d *DurationValue) String() string {
	var current time.Duration
	if d.v != nil {
		current = *(d.v)
	}
	return current.String()
}
153161
func (j *Job) Duration() time.Duration {
	if j.Finished().IsZero() {
		return 0 * time.Second
	}
	return j.Finished().Sub(j.Started())
}
666655
func (t UnixTime) Duration() time.Duration {
	return time.Time(t).Sub(unixEpoch)
}
958355
func (c *Client) Duration(stat string, duration time.Duration, rate float64) error {
	return c.send(stat, rate, "%d|ms", millisecond(duration))
}
1291914
func (s *ExponentialStrategy) Calculate(attempt int) time.Duration {
	backoffDuration := s.cfg.BackoffMultiplier *
		time.Duration(math.Pow(2, float64(attempt)))
	return backoffDuration
}
1027905
func toSeconds(duration time.Duration) time.Duration {
	seconds := duration.Nanoseconds() / nanosecondsPerSecond
	nanoseconds := seconds * nanosecondsPerSecond
	return time.Duration(nanoseconds)
}
491386
func DurationChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "durationchange", Listener: listener}
}
772389
func Duration(p *durpb.Duration) (time.Duration, error) {
	if err := validateDuration(p); err != nil {
		return 0, err
	}
	d := time.Duration(p.Seconds) * time.Second
	if int64(d/time.Second) != p.Seconds {
		return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
	}
	if p.Nanos != 0 {
		d += time.Duration(p.Nanos) * time.Nanosecond
		if (d < 0) != (p.Nanos < 0) {
			return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
		}
	}
	return d, nil
}
1136843
func (v *Duration) String() string {
	return strconv.FormatInt(int64(v.i.Get()), 10)
}
1213665
func (s *_statter) Timing(dur time.Duration) {
	if s.statter == nil {
		s.statter = CurrentStatter
	}

	s.statter.Timing(s.StatterSampleRate, s.StatterBucket, dur)
}