Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterWallClock ¶
AfterWallClock returns a channel that receives after duration d, measured against wall-clock time. Unlike time.After, it is resilient to the system clock jumping forward (e.g. after a suspend/resume cycle): a second ticker fires every second so a large wall-clock jump is detected within 1 s.
Previous implementation spawned a goroutine containing both time.After AND time.NewTicker, i.e. two OS timers per call. The new implementation uses only time.NewTicker and checks elapsed wall-clock time on each tick, which achieves the same goal with one timer and no goroutine leak on the fast path (when the deadline has already passed before the first tick).
Types ¶
This section is empty.