fasttime

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package fasttime provides fast time.Now() and time.Since() and time.Format().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(t time.Time, layout Layout) string

Format is equivlant with time.Format for layouts: RFC3339, RFC3339Milli and RFC3339Nano, but with better performance

func Now

func Now() time.Time

Now is the current time

func NowUnixNano

func NowUnixNano() int64

NowUnixNano is the current Unix Nano time

func Since

func Since(t time.Time) time.Duration

Since returns the elapsed time.

Types

type Layout

type Layout int

Layout is the layout to format a time value

const (
	// RFC3339 is the layout for RFC3339
	RFC3339 Layout = iota
	// RFC3339Milli is the layout for RFC3339 in milli-second
	RFC3339Milli
	// RFC3339Nano is the layout for RFC3339 in nano-second
	RFC3339Nano
)

Jump to

Keyboard shortcuts

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