// Timing implements xstats.Sender interface
422312
func (s sender) Timing(stat string, duration time.Duration, tags ...string) {
	// Not supported, just ignored
}
540594
func (c *expvarStatsClient) Timing(name string, value time.Duration, rate float64) {
	c.mu.Lock()
	d, _ := c.m.Get(name).(time.Duration)
	c.m.Set(name, d+value)
	c.mu.Unlock()
}
1097333
func (c *Client) Timing(name string, value time.Duration, tags []string, rate float64) error {
	return c.TimeInMilliseconds(name, value.Seconds()*1000, tags, rate)
}
958355
func (c *Client) Duration(stat string, duration time.Duration, rate float64) error {
	return c.send(stat, rate, "%d|ms", millisecond(duration))
}
181555
func (e *eventTimestamper) Time() time.Time {
	e.lock.RLock()
	t := e.timestamp
	e.lock.RUnlock()
	return t
}
626875
func NewTiming() *Timing {
	r := &Timing{
		Buckets: make(map[int64]*timingBucket),
		Mutex:   &sync.RWMutex{},
	}
	return r
}
422114
func (c *Client) Timing(stat string, delta int, rate float64) error {
	return c.send(stat, rate, "%d|ms", delta)
}
17123
func (c *crontime) DurationUntilNextEvent() time.Duration {
	return c.nextEvent().Sub(time.Now())
}
336472
func (pt *PlaylistTrack) Time() time.Time {
	t := C.sp_playlist_track_create_time(pt.playlist.sp_playlist, C.int(pt.index))
	return time.Unix(int64(t), 0)
}
32004
func (s *Statsd) Timing(sampleRate float32, bucket string, d ...time.Duration) {
	samp, ok := maybeSample(sampleRate)
	if !ok {
		return
	}

	msgs := make([]sendable, len(d))
	for i, di := range d {
		msgs[i] = &timingUpdate{
			prefix:   s.prefix,
			bucket:   bucket,
			ms:       int(di.Nanoseconds() / 1e6),
			sampling: samp,
		}
	}

	s.publish(msgs)
}
820742
func (ctx *Context) Timing(dt time.Duration, fn func(context.Context)) (err error) {
	ct, cancel := ctx.WithTimeout(dt)
	defer cancel()

	ch := make(chan error, 1) // not block tryRunTiming
	go tryRunTiming(ct, fn, ch)

	select {
	case <-ct.Done():
		err = ct.Err()
	case err = <-ch:
	}
	return
}
1168790
func (h *Timing) ContentLoadTime(contentLoadTime int64) *Timing {
	h.contentLoadTime = contentLoadTime
	h.contentLoadTimeSet = true
	return h
}
175574
func (s *promScope) TimingDuration(stat string, delta time.Duration) {
	s.autoSummary(s.statName(stat) + "_seconds").Observe(delta.Seconds())
}
352230
func (c *Clock) Time() float32 {
	currStamp := theTimer.Now()
	return float32(float64(currStamp-c.startStamp) / float64(secondsInNano))
}
181849
func (p *PacketTime) Time() time.Time {
	return time.Unix(int64(p.Sec), int64(p.Usec)*1000)
}
221200
func (c *Context) Timing(sampleRate float32, bucket string, d ...time.Duration) {
	if rand.Float32() > sampleRate {
		return
	}

	for _, dur := range d {
		c.Log(Data{"metric": bucket, "timing": int64(dur / time.Millisecond)})
	}
}
461474
func (e Timing) Stats() []string {
	return []string{
		fmt.Sprintf("%s.count:%d|c", e.Name, e.Count),
		fmt.Sprintf("%s.avg:%d|ms", e.Name, int64(e.Value/e.Count)), // make sure e.Count != 0
		fmt.Sprintf("%s.min:%d|ms", e.Name, e.Min),
		fmt.Sprintf("%s.max:%d|ms", e.Name, e.Max),
	}
}