lib/clock
import "github.com/eugenioenko/goalchemy/lib/clock"Package clock provides wall time, independent of Goalchemy virtual time.
| Function | c | csharp | go | java | python | rust | swift | typescript |
|---|---|---|---|---|---|---|---|---|
Unix |
yes | yes | yes | yes | yes | yes | yes | yes |
UnixNano |
yes | yes | yes | yes | yes | yes | yes | yes |
func Unix() int64The host wall-clock time in UTC seconds since the Unix epoch.
- Gate:
sequential(never suspends) - Determinism: nondeterministic
- Contract:
lib.clock.unix1.0.0
UnixNano
Section titled “UnixNano”func UnixNano() int64The host wall-clock time in UTC nanoseconds since the Unix epoch.
- Gate:
sequential(never suspends) - Determinism: nondeterministic
- Bounds: Precision is the host clock resolution: milliseconds where only a millisecond clock exists, such as JavaScript Date.now, otherwise microseconds or nanoseconds.
- Contract:
lib.clock.unix_nano1.0.0