File: fake_ticker.go

package info (click to toggle)
golang-github-pivotal-golang-clock 0.0~git20151018.0.3fd3c19-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 104 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 335 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package fakeclock

import (
	"time"

	"github.com/pivotal-golang/clock"
)

type fakeTicker struct {
	timer clock.Timer
}

func newFakeTicker(timer *fakeTimer) *fakeTicker {
	return &fakeTicker{
		timer: timer,
	}
}

func (ft *fakeTicker) C() <-chan time.Time {
	return ft.timer.C()
}

func (ft *fakeTicker) Stop() {
	ft.timer.Stop()
}