// FuzzyDuration randomizes the duration d within the range specified
// by fuzz. Specifically the value range is: [d-(fuzz/2), d+(fuzz/2)]
// The result will never be negative.
7845
func FuzzyDuration(d, fuzz time.Duration) time.Duration {
	if fuzz < 0 {
		return d
	}
	// apply range [-fuzz/2, fuzz/2]
	d += time.Duration(rand.Int63n(int64(fuzz)+1) - (int64(fuzz) / 2))
	if d < 0 {
		return 0
	}
	return d
}
602406
func Fuzz(data []byte) int {
	w := Whoami{}
	return fuzz.Do(w, data)
}
220061
func (b *Build) RunDuration() (duration time.Duration, ok bool) {
	if b.StartTime.IsZero() || b.CompletionTime.IsZero() {
		return 0, false
	}
	return b.CompletionTime.Sub(b.StartTime), true
}
753102
func (s *UpdateMaintenanceWindowInput) SetDuration(v int64) *UpdateMaintenanceWindowInput {
	s.Duration = &v
	return s
}
1106354
func (s *DescribeReservationOutput) SetDuration(v int64) *DescribeReservationOutput {
	s.Duration = &v
	return s
}
601536
func randDuration(n time.Duration) time.Duration {
	return time.Duration(rand.Int63n(int64(n)))
}
680449
func (s *ReservedElasticsearchInstanceOffering) SetDuration(v int64) *ReservedElasticsearchInstanceOffering {
	s.Duration = &v
	return s
}
675589
func (g *Generator) OneDurationOf(values ...time.Duration) time.Duration {
	i := g.Int(0, len(values)-1)
	return values[i]
}
977795
func (s *DescribeReservedDBInstancesInput) SetDuration(v string) *DescribeReservedDBInstancesInput {
	s.Duration = &v
	return s
}
1372820
func (h *Histogram) RecordDuration(v time.Duration) error {
	return h.RecordIntScale(int64(v), -9)
}
904114
func (s *Scte35SpliceInsertScheduleActionSettings) SetDuration(v int64) *Scte35SpliceInsertScheduleActionSettings {
	s.Duration = &v
	return s
}
315496
func backoffDuration(retryCount int) time.Duration {
	// Upper limit of delay at ~1 minute
	if retryCount > 7 {
		retryCount = 7
	}

	rand.Seed(time.Now().UnixNano())
	delay := (1 << uint(retryCount)) * (rand.Intn(150) + 500)
	return time.Duration(delay) * time.Millisecond
}
338348
func Fuzz(data []byte) int {
	var v map[string]interface{}
	if err := Unmarshal(data, &v); err != nil {
		return 0
	}
	return 1
}
538456
func (s *Reservation) SetDuration(v int64) *Reservation {
	s.Duration = &v
	return s
}
672039
func (s *ReservedNodeOffering) SetDuration(v int64) *ReservedNodeOffering {
	s.Duration = &v
	return s
}
326178
func (s *ReservedCacheNodesOffering) SetDuration(v int64) *ReservedCacheNodesOffering {
	s.Duration = &v
	return s
}
973940
func fromDuration(t time.Duration) microseconds {
	return microseconds(float64(t) / float64(time.Microsecond))
}