Registry / testing / jmhodges-clock

jmhodges-clock

JSON →
library1.2.0gogounverified

Package clock provides an abstraction for system time to enable testing of time-sensitive code.

go get github.com/jmhodges/clock
INSTALL
IMPORT
SIG · JMHODGES-CLOCK
J
jmhodges-clock
testinggov1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

clock
github.com/jmhodges/clock

Use a fake clock for testing

package main import ( "fmt" "github.com/jmhodges/clock" ) func main() { clk := clock.NewFake() clk.Add(5 * time.Second) fmt.Println(clk.Now()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.2.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jmhodges-clock — go get jmhodges-clock · libregistry