// Round will round the timestamp of the point to the given duration.
335573
func (p *point) Round(d time.Duration) {
	p.time = p.time.Round(d)
}
356313
func (tr Row) Duration(nn int) (val time.Duration) {
	val, err := tr.DurationErr(nn)
	if err != nil {
		panic(err)
	}
	return
}
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
}
892596
func DurationToTS(d time.Duration) uint64 {
	return oracle.ComposeTS(d.Nanoseconds()/int64(time.Millisecond), 0)
}
1251260
func (m *Money) Round() *Money {
	return &Money{amount: mutate.calc.round(m.amount, m.currency.Fraction), currency: m.currency}
}
117863
func (t *Trace) Duration() time.Duration {
	if t.End.IsZero() {
		return -1
	}
	return t.End.Sub(t.Start)
}
48518
func (ev *EventObject) Timestamp() int {
	ms := ev.Get("timeStamp").Int()
	s := ms / 1000
	// ns := (ms % 1000 * 1e6)
	// return time.Unix(int64(s), int64(ns))
	return s
}
11143
func (o Timestamp) Time() time.Time {
	return time.Unix(0, int64((o-gregorianToUNIXOffset)*100)).UTC()
}
524653
func (c *StatsdClient) PrecisionTiming(stat string, delta time.Duration) error {
	return c.send(stat, "%.6f|ms", float64(delta)/float64(time.Millisecond), 1)
}
822871
func roundFunc(q query, t iterator) interface{} {
	val := asNumber(t, q.Evaluate(t))
	//return math.Round(val)
	return round(val)
}
930160
func (sb *StatsdBuffer) PrecisionTiming(stat string, delta time.Duration) error {
	sb.eventChannel <- event.NewPrecisionTiming(stat, delta)
	return nil
}
936749
func round(f float64) int {
	if math.Abs(f) < 0.5 {
		return 0
	}
	return int(f + math.Copysign(0.5, f))
}
642992
func Duration(key string, t time.Duration) log.Field {
	return log.String(key, fmt.Sprint(t))
}
254245
func roundDuration(in int64) int64 {
	abs := in
	if abs < 0 {
		abs = -abs
	}
	if abs <= 10 { // 10s -> don't round
		return in
	} else if abs <= 60 { // 1min -> round to 10s
		return round(in, 10)
	} else if abs <= 600 { // 10min -> round to 1min
		return round(in, 60)
	} else if abs <= 3600 { // 1h -> round to 10min
		return round(in, 600)
	} else if abs <= 3600*24 { // 24h -> round to 1h
		return round(in, 3600)
	} else if abs <= 3600*24*7 { // 7d -> round to 1d
		return round(in, 3600*24)
	} else if abs <= 3600*24*30 { // 30d -> round to 7d
		return round(in, 3600*24*7)
	}
	// default to rounding to months
	return round(in, 3600*24*30)
}
1033753
func (as ArraySpec) Round(val Input) Input {
	return as.proc(func(i Input) Input {
		return i.Round(val)
	})
}
183569
func (timestamp Timestamp) Format(format string) string {
	t := time.Time(timestamp)
	return t.Format(format)
}
492062
func (t *Track) Duration() time.Duration {
	ms := C.sp_track_duration(t.sp_track)
	return time.Duration(ms) * time.Millisecond
}