timeext

package
v5.30.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0, MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// RFC3339Nano is a correct replacement to Go's current time.RFC3339Nano which is NOT sortable and
	// have no intention of fixing https://github.com/golang/go/issues/19635; this format fixes that.
	RFC3339Nano = "2006-01-02T15:04:05.000000000Z07:00"
)

Variables

This section is empty.

Functions

func NanoTime added in v5.14.0

func NanoTime() int64

NanoTime returns a monotonically increasing time in nanoseconds.

Types

type Instant added in v5.21.0

type Instant int64

Instant represents a monotonic instant in time.

Instants are opaque types that can only be compared with one another and allows measuring of duration.

func NewInstant added in v5.21.0

func NewInstant() Instant

NewInstant returns a new Instant.

func (Instant) Elapsed added in v5.21.0

func (i Instant) Elapsed() time.Duration

Elapsed returns the duration since the instant was created.

func (Instant) Since added in v5.21.0

func (i Instant) Since(instant Instant) time.Duration

Since returns the duration elapsed from another Instant, or zero is that Instant is later than this one.

Jump to

Keyboard shortcuts

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