mono

package
v1.45.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 1 Imported by: 24

Documentation

Overview

These APIs encode monotonic time into time.Time wall-clock fields. Returned values intentionally do not carry Go's internal monotonic payload and are meant to be compared with other mono timestamps.

More details: https://go.googlesource.com/proposal/+/master/design/12914-monotonic.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromTime

func FromTime(t time.Time) time.Time

FromTime creates a Time from the monotonic part of t. Note that the monotonic part of t could have been erased when using functions like Truncate, Round, In, UTC, etc... Be careful when using this

func Now

func Now() time.Time

Now creates a monotonic time without reading the system wall clock

func Parse added in v1.42.1

func Parse(layout, value string) (time.Time, error)

Parse is an analog of time.Parse that produces monotonic time.

func Unix added in v1.42.1

func Unix(sec, nsec int64) time.Time

Unix is an analog of time.Unix that produces monotonic time.

func UnixMicro

func UnixMicro() int64

UnixMicro returns the number of microseconds elapsed, based on the application start time.

func UnixNano

func UnixNano() int64

UnixNano returns the number of nanoseconds elapsed, based on the application start time.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL