func (t *timeoutTicker) stopTimer() {
	if !t.timer.Stop() {
		select {
		case <-t.timer.C:
		default:
			t.logger.Debug("Timer already stopped")
		}
	}
}
-------------------------------------------------------------
stop the timer and drain if necessary
package consensus
import (
	"time"
	"go.uber.org/zap"
	. "github.com/annchain/annchain/module/lib/go-common"
)
var (
	tickTockBufferSize = 10
)
type TimeoutTicker interface {
	Start() (bool, error)
	Stop() bool
	Chan() <-chan timeoutInfo        
	ScheduleTimeout(ti timeoutInfo)  
}
type timeoutTicker struct {
	BaseService
	timer    *time.Timer
	tickChan chan timeoutInfo
	tockChan chan timeoutInfo
	logger  *zap.Logger
	slogger *zap.SugaredLogger
}
func NewTimeoutTicker(logger *zap.Logger) TimeoutTicker {
	tt := &timeoutTicker{
		timer:    time.NewTimer(0),
		tickChan: make(chan timeoutInfo, tickTockBufferSize),
		tockChan: make(chan timeoutInfo, tickTockBufferSize),
		logger:  logger,
		slogger: logger.Sugar(),
	}
	tt.stopTimer()  
	tt.BaseService = *NewBaseService(logger, "TimeoutTicker", tt)
	return tt
}
func (t *timeoutTicker) OnStart() error {
	t.BaseService.OnStart()
	go t.timeoutRoutine()
	return nil
}
func (t *timeoutTicker) OnStop() {
	t.BaseService.OnStop()
	t.stopTimer()
}
func (t *timeoutTicker) Chan() <-chan timeoutInfo {
	return t.tockChan
}
func (t *timeoutTicker) ScheduleTimeout(ti timeoutInfo) {
	t.tickChan <- ti
}