Documentation ¶
Overview ¶
Package ttime implements a testable alternative to the Go "time" package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultTime ¶
type DefaultTime struct{}
DefaultTime is a Time that behaves normally
func (*DefaultTime) After ¶
func (*DefaultTime) After(d time.Duration) <-chan time.Time
After sleeps for the given duration and then writes to to the returned channel
func (*DefaultTime) AfterFunc ¶
func (*DefaultTime) AfterFunc(d time.Duration, f func()) Timer
AfterFunc waits for the duration to elapse and then calls f in its own goroutine. It returns a Timer that can be used to cancel the call using its Stop method.
func (*DefaultTime) Sleep ¶
func (*DefaultTime) Sleep(d time.Duration)
Sleep sleeps for the given duration
Click to show internal directories.
Click to hide internal directories.