Documentation
¶
Overview ¶
Package clock provides a Clock interface and implementations for production and deterministic test use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
Clock provides time operations. Inject RealClock in production and FakeClock in tests that need deterministic timing.
type FakeClock ¶
type FakeClock struct {
// contains filtered or unexported fields
}
FakeClock is a Clock with controllable time for deterministic tests. Time advances only when Advance is called explicitly.
func (*FakeClock) Advance ¶
Advance moves the clock forward by d and fires any tickers whose interval has elapsed. Tickers with a full channel drop the excess tick (same behavior as the real time.Ticker under load).
Click to show internal directories.
Click to hide internal directories.