package clocks
import "github.com/bep/clocks"
Index ¶
Variables ¶
TimeCupFinalNorway1976 is the start time in UTC for the final match of the 1976 Norwegian Football Cup. This is typically used in tests where you need a historic time with a special meaning.
Types ¶
type Clock ¶
type Clock interface { Now() time.Time Since(t time.Time) time.Duration Until(t time.Time) time.Duration // Offset returns the offset of this clock relative to the system clock. Offset() time.Duration }
Clock provides the sub set of methods in time.Time that this package provides.
func Fixed ¶
Fixed returns a Clock that always returns the given time.
func Start ¶
Start creates a new Clock starting at t.
func System ¶
func System() Clock
System is a Clock that uses the system clock, meaning it just delegates to time.Now() etc.
Source Files ¶
- Version
- v0.5.0 (latest)
- Published
- Aug 8, 2022
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 3 days ago –
Tools for package owners.