Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicMono ¶
type AtomicMono = crsync.TypedAtomicInt64[Mono]
AtomicMono provides atomic access to a Mono value.
type Mono ¶
Mono represents a moment in time in terms of a monotonic clock. Its value is the duration since the start of the process.
Note that if the system doesn't support a monotonic clock, the wall clock is used.
func MonoFromTime ¶
MonoFromTime converts a time.Time to a Mono value. If the time has a monotonic component, it is used.
func NowMono ¶
func NowMono() Mono
NowMono returns a moment in time in terms of a monotonic clock. It is faster than time.Now which also consults the wall clock.
func (Mono) ToUTC ¶
ToUTC returns the UTC time corresponding to the monotonic time.
The time is derived from the current wall clock, adjusted by the difference in the monotonic clock values. Note that if the wall clock has been changed since the Mono value was obtained, the result does not reflect the wall clock at that point in time.