func (p *PredefinedFake) NewTimer(d time.Duration) Timer {
	glog.Exitf("PredefinedFake.NewTimer is not implemented")
	return nil
}
NewTimer creates a timer with the specified delay. Not implemented.
package clock
import (
	"sync"
	"time"
	"github.com/golang/glog"
)
var System TimeSource = systemTimeSource{}
type TimeSource interface {
	Now() time.Time
	NewTimer(d time.Duration) Timer
}
func SecondsSince(ts TimeSource, t time.Time) float64 {
	return ts.Now().Sub(t).Seconds()
}
type systemTimeSource struct{}
func (s systemTimeSource) Now() time.Time {
	return time.Now()
}
func (s systemTimeSource) NewTimer(d time.Duration) Timer {
	return systemTimer{time.NewTimer(d)}
}
type FakeTimeSource struct {
	mu     sync.RWMutex
	now    time.Time
	timers map[int]*fakeTimer
	nextID int
}
func NewFake(t time.Time) *FakeTimeSource {
	timers := make(map[int]*fakeTimer)
	return &FakeTimeSource{now: t, timers: timers}
}
func (f *FakeTimeSource) Now() time.Time {
	f.mu.RLock()
	defer f.mu.RUnlock()
	return f.now
}
func (f *FakeTimeSource) NewTimer(d time.Duration) Timer {
	f.mu.Lock()
	defer f.mu.Unlock()
	id := f.nextID
	f.nextID++
	timer := newFakeTimer(f, id, f.now.Add(d))
	f.timers[id] = timer
	return timer
}
func (f *FakeTimeSource) unsubscribe(id int) bool {
	f.mu.Lock()
	defer f.mu.Unlock()
	_, ok := f.timers[id]
	if ok {
		delete(f.timers, id)
	}
	return ok
}
func (f *FakeTimeSource) Set(t time.Time) {
	f.mu.Lock()
	defer f.mu.Unlock()
	f.now = t
	for id, timer := range f.timers {
		if timer.tryFire(t) {
			delete(f.timers, id)
		}
	}
}
type PredefinedFake struct {
	Base   time.Time
	Delays []time.Duration
	Next   int
}
func (p *PredefinedFake) Now() time.Time {
	adjustedTime := p.Base.Add(p.Delays[p.Next])
	p.Next++
	return adjustedTime
}