// Timing submits a statsd timing type.
// stat is a string name for the metric.
// delta is the time duration value in milliseconds
// rate is the sample rate (0.0 to 1.0).
776137
func (s *NoopClient) Timing(stat string, delta int64, rate float32) error {
	return nil
}
698950
func Timing(sampleRate float32, bucket string, d ...time.Duration) {
	CurrentStatter.Timing(sampleRate, bucket, d...)
}
1066748
func (t *Timings) Time() int64 {
	t.mu.Lock()
	defer t.mu.Unlock()
	return t.totalTime
}
27740
func (s *StdoutClient) Timing(stat string, delta int64) error {
	return s.send(stat, "%d|ms", delta)
}
79533
func (m *TimerMetrics) StatusDuration(duration time.Duration) {
	if m.statusEvery == 0 {
		return
	}

	m.Lock()
	m.position++
	var looped bool
	if m.position > m.statusEvery {
		// loop back around
		looped = true
		m.position = 1
	}
	if m.position > len(m.timings) {
		m.timings = append(m.timings, duration)
	} else {
		m.timings[m.position-1] = duration
	}

	if !looped {
		m.Unlock()
		return
	}

	stats := m.getStats()
	m.Unlock()

	log.Printf("%s", stats)
}
802921
func (s *sender) Timing(stat string, value time.Duration, tags ...string) {
	s.Called(stat, value, tags)
}
137628
func (pc PulseCount) Rate(rate int8) Input {
	CheckRate(rate)
	(&pc).defaults()
	return NewInput("PulseCount", rate, 0, 1, pc.Trig, pc.Reset)
}
399007
func (k *Key) Duration() (time.Duration, error) {
	return time.ParseDuration(k.String())
}
420608
func (pd PulseDivider) Rate(rate int8) Input {
	CheckRate(rate)
	(&pd).defaults()
	return NewInput("PulseDivider", rate, 0, 1, pd.Trig, pd.Div, pd.Start)
}
1152330
func (t *Track) Tempo() int {
	if t == nil {
		return 0
	}
	tempoEvType := MetaByteMap["Tempo"]
	for _, ev := range t.Events {
		if ev.Cmd == tempoEvType {
			return int(ev.Bpm)
		}
	}
	return 0
}
1213665
func (s *_statter) Timing(dur time.Duration) {
	if s.statter == nil {
		s.statter = CurrentStatter
	}

	s.statter.Timing(s.StatterSampleRate, s.StatterBucket, dur)
}
50313
func (t ntpTimeShort) Duration() time.Duration {
	t64 := uint64(t)
	sec := (t64 >> 16) * nanoPerSec
	frac := (t64 & 0xffff) * nanoPerSec >> 16
	return time.Duration(sec + frac)
}
723980
func (c *Context) Duration(name string) time.Duration {
	return lookupDuration(name, c.flagSet)
}
1194538
func Stat(name string) (time.Time, error) {
	fi, err := os.Stat(name)
	if err != nil {
		return time.Time{}, err
	}
	return atime(fi), nil
}
1252575
func (c *StatsdClient) TimingWithSampling(stat string, delta int64, sampleRate float32) error {
	if err := checkSampleRate(sampleRate); err != nil {
		return err
	}

	if !shouldFire(sampleRate) {
		return nil // ignore this call
	}

	return c.send(stat, "%d|ms", delta, sampleRate)
}
930160
func (sb *StatsdBuffer) PrecisionTiming(stat string, delta time.Duration) error {
	sb.eventChannel <- event.NewPrecisionTiming(stat, delta)
	return nil
}
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)
	}
}