// DurationChange is an event fired when the duration attribute has been
// updated.
//
// https://developer.mozilla.org/docs/Web/Events/durationchange
491386
func DurationChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "durationchange", Listener: listener}
}
800624
func (c *Client) Duration(name string, duration time.Duration) error {
	return c.send(name, 1, "%d|ms", millisecond(duration))
}
475649
func ChargingTimeChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "chargingtimechange", Listener: listener}
}
1324645
func ControlChange(channel, controller, newVal int) *Event {
	return &Event{
		MsgChan:    uint8(channel),
		MsgType:    uint8(EventByteMap["ControlChange"]),
		Controller: uint8(controller),
		NewValue:   uint8(newVal),
	}
}
33814
func (a Accuracy) Duration() time.Duration {
	return 0 +
		time.Duration(a.Seconds)*time.Second +
		time.Duration(a.Millis)*time.Millisecond +
		time.Duration(a.Micros)*time.Microsecond
}
23004
func Duration(val string) (*duration.Duration, error) {
	var r *duration.Duration
	err := jsonpb.UnmarshalString(val, r)
	return r, err
}
17642
func (s *Settings) AddOnChange(key string, cb OnChangeCallback) {
	s.lock.Lock()
	defer s.lock.Unlock()
	if s.onChangeCallbacks == nil {
		s.onChangeCallbacks = make(map[string]OnChangeCallback)
	}
	s.onChangeCallbacks[key] = cb
}
480746
func TimeRange(from time.Time, duration time.Duration) gopter.Gen {
	return func(genParams *gopter.GenParameters) *gopter.GenResult {
		v := from.Add(time.Duration(genParams.Rng.Int63n(int64(duration))))
		return gopter.NewGenResult(v, TimeShrinker)
	}
}
1085523
func DeviceChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "devicechange", Listener: listener}
}
1150039
func (r *Reader) Duration(name string) time.Duration {
	return r.DurationDefault(name, 0)
}
1138998
func (p *parserMixin) DurationVar(target *time.Duration) {
	p.SetValue(newDurationValue(target))
}
666655
func (t UnixTime) Duration() time.Duration {
	return time.Time(t).Sub(unixEpoch)
}
1153428
func VolumeChange(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "volumechange", Listener: listener}
}
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")
}
52434
func (fs *FlagSet) DurationVar(p *time.Duration, names []string, value time.Duration, usage string) {
	fs.Var(newDurationValue(value, p), names, usage)
}
686147
func (d *Duration) Swap(n time.Duration) time.Duration {
	return time.Duration(d.v.Swap(int64(n)))
}
892596
func DurationToTS(d time.Duration) uint64 {
	return oracle.ComposeTS(d.Nanoseconds()/int64(time.Millisecond), 0)
}