Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SysSleepConsumer = func(d time.Duration) { time.Sleep(d) }
SysSleepConsumer is the default system sleep consumer
View Source
var SysTimeProvider = func() time.Time { return time.Now() }
SysTimeProvider is the default system time provider
Functions ¶
This section is empty.
Types ¶
type SleepConsumer ¶
SleepConsumer sleeps the given amount of time. This is usually the time.Sleep method, but can be something else for unit tests.
type TimeProvider ¶
A TimeProvider returns the current time. This is usually the system time, but can be something else for unit tests.
type Timer ¶
type Timer struct { TimeProvider TimeProvider SleepConsumer SleepConsumer // contains filtered or unexported fields }
A Timer can be started and stopped. It will start at zero and count up, while running. It is event driven, there are now threads that update any state.
func (*Timer) WaitTillNextFullSecond ¶
WaitTillNextFullSecond waits until the internal timer has reached the next full second
Click to show internal directories.
Click to hide internal directories.