// ToUnixMilli returns milliseconds since epoch from time.Time
166557
func ToUnixMilli(t time.Time) int64 {
	return t.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
}
555499
func (a Amount) ToUnit(u AmountUnit) float64 {
	return float64(a) / math.Pow10(int(u+8))
}
1253177
func xtoi(s string, i0 int) (n int, i int, ok bool) {
	n = 0
	for i = i0; i < len(s); i++ {
		if '0' <= s[i] && s[i] <= '9' {
			n *= 16
			n += int(s[i] - '0')
		} else if 'a' <= s[i] && s[i] <= 'f' {
			n *= 16
			n += int(s[i]-'a') + 10
		} else if 'A' <= s[i] && s[i] <= 'F' {
			n *= 16
			n += int(s[i]-'A') + 10
		} else {
			break
		}
		if n >= big {
			return 0, i, false
		}
	}
	if i == i0 {
		return 0, i, false
	}
	return n, i, true
}
1000056
func (s *CreateIntegrationInput) SetTimeoutInMillis(v int64) *CreateIntegrationInput {
	s.TimeoutInMillis = &v
	return s
}
859023
func (s *UpdateGroupCertificateConfigurationOutput) SetCertificateExpiryInMilliseconds(v string) *UpdateGroupCertificateConfigurationOutput {
	s.CertificateExpiryInMilliseconds = &v
	return s
}
594149
func (s *Timing) SetFinishTimeMillis(v int64) *Timing {
	s.FinishTimeMillis = &v
	return s
}
366543
func MilliCPUToShares(milliCPU int64) uint64 {
	if milliCPU == 0 {
		// Docker converts zero milliCPU to unset, which maps to kernel default
		// for unset: 1024. Return 2 here to really match kernel default for
		// zero milliCPU.
		return MinShares
	}
	// Conceptually (milliCPU / milliCPUToCPU) * sharesPerCPU, but factored to improve rounding.
	shares := (milliCPU * SharesPerCPU) / MilliCPUToCPU
	if shares < MinShares {
		return MinShares
	}
	return uint64(shares)
}
76087
func milliTime() (r []byte) {
	buf := new(bytes.Buffer)
	t := time.Now().UnixNano()
	m := t / 1e6
	binary.Write(buf, binary.BigEndian, m)
	return buf.Bytes()[2:]
}
1761
func (s *Timing) SetSubmitTimeMillis(v int64) *Timing {
	s.SubmitTimeMillis = &v
	return s
}
103831
func toInt64(v reflect.Value) int64 {
	i, _ := tryToInt64(v)
	return i
}
1139675
func (c *Client) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error {
	return c.send(name, value, timingSuffix, tags, rate)
}
391377
func (d *adxl345DataFormat) ConvertToSI(rawValue int16) float64 {
	switch d.sensorRange {
	case ADXL345_RANGE_2G:
		return float64(rawValue) * 2 / 512
	case ADXL345_RANGE_4G:
		return float64(rawValue) * 4 / 512
	case ADXL345_RANGE_8G:
		return float64(rawValue) * 8 / 512
	case ADXL345_RANGE_16G:
		return float64(rawValue) * 16 / 512
	default:
		return 0
	}
}
1013940
func FromUnixMilli(milli int64) time.Time {
	return time.Unix(0, milli*int64(time.Millisecond))
}
527825
func MilliSleep(tm int) {
	time.Sleep(time.Duration(tm) * time.Millisecond)
}
1360590
func unaryOpMidiratio(rate int8, in Input, numOutputs int) Input {
	CheckRate(rate)
	return NewInput(UnaryOpUgenName, rate, UnaryOpMidiratio, numOutputs, in)
}
236021
func unaryOpRatiomidi(rate int8, in Input, numOutputs int) Input {
	CheckRate(rate)
	return NewInput(UnaryOpUgenName, rate, UnaryOpRatiomidi, numOutputs, in)
}
531439
func (s *GetGroupCertificateConfigurationOutput) SetCertificateAuthorityExpiryInMilliseconds(v string) *GetGroupCertificateConfigurationOutput {
	s.CertificateAuthorityExpiryInMilliseconds = &v
	return s
}