package dregarnuhr import "time" type Timer interface { C() <-chan time.Time Stop() bool } type Clock interface { Now() time.Time NewTimer(time.Duration) Timer } type SystemClock struct{} func (SystemClock) Now() time.Time { return time.Now() } func (SystemClock) NewTimer(d time.Duration) Timer { return systemTimer{time.NewTimer(d)} } type systemTimer struct{ *time.Timer } func (t systemTimer) C() <-chan time.Time { return t.Timer.C }