Documentation
¶
Overview ¶
Package clocktest provides deterministic clocks for tests that coordinate concurrent work around absolute deadlines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manual ¶
type Manual struct {
// contains filtered or unexported fields
}
Manual is a concurrency-safe clock advanced explicitly by tests. Timer registration and the current time are checked under one lock, so a deadline cannot move from the future to the past between those operations.
func (*Manual) Advance ¶
Advance moves the clock forward and fires every timer whose deadline has elapsed.
func (*Manual) NewTimerAt ¶
NewTimerAt registers a one-shot timer for deadline. The returned stop function reports whether it stopped an active timer.
func (*Manual) TimerCount ¶
TimerCount reports the number of active timers.
Click to show internal directories.
Click to hide internal directories.