func delTimer(t *Timer) (b bool) {
	mutex.Lock()
	b = delTimerLocked(t)
	mutex.Unlock()
	return
}
Delete timer t from the heap.
It returns true if t was removed, false if t wasn't even there.
Do not need to update the timer routine: if it wakes up early, no big deal.
package timer
import (
	"sync"
	"time"
)
var (
	mutex       sync.Mutex
	timers      []*Timer
	rescheduleC = make(chan struct{}, 1)
)
func init() {
	go timerRoutine()
}
func when(d time.Duration) int64 {
	if d <= 0 {
		return time.Now().UnixNano()
	}
	t := time.Now().UnixNano() + int64(d)
	if t < 0 {
		t = 1<<63 - 1  
	}
	return t
}
func addTimer(t *Timer, d time.Duration) {
	t.when = when(d)
	mutex.Lock()
	addTimerLocked(t)
	mutex.Unlock()
}
func addTimerLocked(t *Timer) {
	t.i = len(timers)
	timers = append(timers, t)
	siftupTimer(t.i)
	if t.i == 0 {
		reschedule()
	}
}