// Ticker creates a new instance of Ticker.
335529
func (m *Mock) Ticker(d time.Duration) *Ticker {
	m.mu.Lock()
	defer m.mu.Unlock()
	ch := make(chan time.Time, 1)
	t := &Ticker{
		C:    ch,
		c:    ch,
		mock: m,
		d:    d,
		next: m.now.Add(d),
	}
	m.timers = append(m.timers, (*internalTicker)(t))
	return t
}
979959
func (u *UpdateChecker) Start() bool {
	if u.ticker != nil {
		return false
	}
	u.ticker = time.NewTicker(u.tickDuration)
	go func() {
		// If we haven't done an update recently, check now.
		// If there is an error getting the last update time, we don't trigger a
		// check and let the ticker below trigger it.
		if !u.updater.config.IsLastUpdateCheckTimeRecent(u.tickDuration) {
			u.Check()
		}

		u.log.Debugf("Starting (ticker %s)", u.tickDuration)
		for range u.ticker.C {
			u.log.Debugf("%s", "Checking for update (ticker)")
			u.Check()
		}
	}()
	return true
}
203000
func (t *T) Pause() {
	if t.ticker != nil {
		t.ticker.Stop()
		t.ticker = nil
	}
}
880045
func (w *Writer) Start() {
	if w.ticker == nil {
		w.ticker = time.NewTicker(w.RefreshInterval)
		w.tdone = make(chan bool, 1)
	}

	go w.Listen()
}
349792
func (c *Connection) receiveTicker() {
	c.hbd.rc = 0
	var first, last, nd int64
hbGet:
	for {
		nd = c.hbd.rti - (last - first)
		// Check if receives are supposed to be "fast" *and* we spent a
		// lot of time in the previous loop.
		if nd <= 0 {
			nd = c.hbd.rti
		}
		ticker := time.NewTicker(time.Duration(nd))
		select {
		case ct := <-ticker.C:
			first = time.Now().UnixNano()
			ticker.Stop()
			c.hbd.rdl.Lock()
			flr := c.hbd.lr
			ld := ct.UnixNano() - flr
			c.log("HeartBeat Receive TIC", "TickerVal", ct.UnixNano(),
				"LastReceive", flr, "Diff", ld)
			if ld > (c.hbd.rti + (c.hbd.rti / 5)) { // swag plus to be tolerant
				c.log("HeartBeat Receive Read is dirty")
				c.Hbrf = true // Flag possible dirty connection
			} else {
				c.Hbrf = false // Reset
				c.hbd.rc++
			}
			c.hbd.rdl.Unlock()
			last = time.Now().UnixNano()
		case _ = <-c.hbd.rsd:
			ticker.Stop()
			break hbGet
		case _ = <-c.ssdc:
			ticker.Stop()
			break hbGet
		} // End of select
	} // End of for
	c.log("Heartbeat Receive Ends", time.Now())
	return
}
918778
func (ticker *Ticker) Close() {
	ticker.timeTicker.Stop()
	close(ticker.closing)
	<-ticker.closed
}
457227
func (l Tickers) AddTicker(id int32, t tick.Ticker) {
	l.Lock()
	l.list[id] = t
	l.Unlock()
}
1307993
func initInfluxDBTicker(ctx context.Context, config *types.InfluxDB) *time.Ticker {
	pushInterval, err := time.ParseDuration(config.PushInterval)
	if err != nil {
		log.FromContext(ctx).Warnf("Unable to parse %s from config.PushInterval: using 10s as the default value", config.PushInterval)
		pushInterval = 10 * time.Second
	}

	report := time.NewTicker(pushInterval)

	safe.Go(func() {
		var buf bytes.Buffer
		influxDBClient.WriteLoop(report.C, &influxDBWriter{buf: buf, config: config})
	})

	return report
}
1191842
func (b *Bittrex) GetTicker(market string) (ticker Ticker, err error) {
	r, err := b.client.do("GET", "public/getticker?market="+strings.ToUpper(market), "", false)
	if err != nil {
		return
	}
	var response jsonResponse
	if err = json.Unmarshal(r, &response); err != nil {
		return
	}
	if err = handleErr(response); err != nil {
		return
	}
	err = json.Unmarshal(response.Result, &ticker)
	return
}
402356
func NewEventer(ctx context.Context, logger hclog.Logger) *Eventer {
	e := &Eventer{
		events: make(chan *drivers.TaskEvent),
		ctx:    ctx,
		logger: logger,
	}
	go e.eventLoop()
	return e
}
1118743
func NewBroker(opts ...broker.Option) broker.Broker {
	options := broker.Options{
		Context: context.Background(),
	}

	for _, o := range opts {
		o(&options)
	}

	return &sqsBroker{
		options: options,
	}
}
1035234
func (a *auther) signer() Signer {
	if a.config.Signer != nil {
		return a.config.Signer
	}
	return &HMACSigner{ConsumerSecret: a.config.ConsumerSecret}
}
634463
func (c *Currency) Formatter() *Formatter {
	return &Formatter{
		Fraction: c.Fraction,
		Decimal:  c.Decimal,
		Thousand: c.Thousand,
		Grapheme: c.Grapheme,
		Template: c.Template,
	}
}
1199705
func Tick(d Doner) <-chan struct{} {
	c := make(chan struct{})
	cq := d.Done()
	go func() {
		for {
			select {
			case <-cq:
				close(c)
				return
			default:
				select {
				case c <- struct{}{}:
				case <-cq:
				}
			}
		}
	}()
	return c
}
488101
func Dialer(dialer *net.Dialer) Option {
	return func(o *Options) error {
		o.Dialer = dialer
		return nil
	}
}
976675
func (s *Send) Sticker(stick interface{}) *SendSticker {
	return &SendSticker{s, stick, nil, nil}
}
1230400
func New(options ...Option) *Formatter {
	f := &Formatter{
		baseLineNumber: 1,
	}
	for _, option := range options {
		option(f)
	}
	return f
}