// MustDuration reads string then parse as duration from config file,
// panic if file not exists
352315
func (r *Reader) MustDuration(name string) time.Duration {
	b, err := r.readDuration(name)
	if err != nil {
		panic(err)
	}
	return b
}
1255937
func (s *ApplicationMetrics) SetDuration(v int64) *ApplicationMetrics {
	s.Duration = &v
	return s
}
704819
func (s *ReservedDBInstancesOffering) SetDuration(v int64) *ReservedDBInstancesOffering {
	s.Duration = &v
	return s
}
13897
func (s *LoggingStatter) SafeTimingDuration(stat string, delta time.Duration, rate float32) {
	if err := s.TimingDuration(stat, delta, rate); err != nil {
		logger.WithError(err).Errorf("Error sending stat %s TimingDuration to statsd", stat)
	}
}
241897
func (s *StaticImageActivateScheduleActionSettings) SetDuration(v int64) *StaticImageActivateScheduleActionSettings {
	s.Duration = &v
	return s
}
712077
func (c *Config) ReadDuration(id string) (time.Duration, error) {
	val, ok := c.Options[id]
	if !ok {
		return time.Duration(0), fmt.Errorf("Specified config is missing from options")
	}
	dval, err := time.ParseDuration(val)
	if err != nil {
		return time.Duration(0), fmt.Errorf("Failed to parse %s as time duration: %s", val, err)
	}
	return dval, nil
}
958334
func NewDuration(val time.Duration, p *time.Duration) *Duration {
	*p = val
	return (*Duration)(p)
}
426398
func (s *TimeSpan) SetDuration(v string) *TimeSpan {
	s.Duration = &v
	return s
}
1036288
func (s *DescribeReservedCacheNodesOfferingsInput) SetDuration(v string) *DescribeReservedCacheNodesOfferingsInput {
	s.Duration = &v
	return s
}
486480
func allowedDuration(duration time.Duration) bool {
	if duration < time.Second {
		return false
	}
	return duration <= time.Minute
}
977795
func (s *DescribeReservedDBInstancesInput) SetDuration(v string) *DescribeReservedDBInstancesInput {
	s.Duration = &v
	return s
}
887002
func (m *Manager) GetDuration(key string) time.Duration {
	return cast.ToDuration(m.Get(key))
}
1154857
func (ts TimeStamp) AddDuration(interval time.Duration) TimeStamp {
	return ts + TimeStamp(interval/time.Second)
}
1273856
func (cfg Config) FormatRelativeDuration(d time.Duration) string {

	isPast := d >= 0

	if d < 0 {
		d = -d
	}

	s, _ := cfg.getTimeText(d, true)

	if isPast {
		return strings.Join([]string{cfg.PastPrefix, s, cfg.PastSuffix}, "")
	} else {
		return strings.Join([]string{cfg.FuturePrefix, s, cfg.FutureSuffix}, "")
	}
}
538456
func (s *Reservation) SetDuration(v int64) *Reservation {
	s.Duration = &v
	return s
}
446253
func (c *Config) ReadDurationDefault(id string, defaultValue time.Duration) time.Duration {
	val, err := c.ReadDuration(id)
	if err != nil {
		return defaultValue
	}
	return val
}
1108177
func TrackDuration(f func() error) (time.Duration, error) {
	ts := timeNow()
	err := f()
	d := timeNow().Sub(ts)
	return d, err
}