Documentation
¶
Overview ¶
Package clock provides a simple abstraction around the standard time package.
- Set and "freeze" the wall clock in test code, with provided wrappers for
- time.Now
- time.Since
- Skip sleeps in test code, with provided wrappers for
- time.Sleep
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResumeSleeps ¶
ResumeSleeps causes time.Sleep to resume default behavior. This should only be called by test code.
func SetAndFreezeClock ¶
SetAndFreezeClock will set the value to be returned by Now. This should only be called by test code.
func SkipSleeps ¶
SkipSleeps causes time.Sleep to sleep for only a small, negligible duration. This should only be called by test code.
func UnfreezeClock ¶
UnfreezeClock will revert clock.Now's behavior to delegating to time.Now. This should only be called by test code.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.