time

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package time provides helper functionality built on top of the standard library time package.

Index

Constants

This section is empty.

Variables

View Source
var TimeFunc func() time.Time = func() time.Time {
	return time.Now()
}

Set to a different function for testing, e.g. one that always returns the same fixed time. Defaults to TimeNow.

Functions

func AddDurationToUnixNano

func AddDurationToUnixNano(t int64, add time.Duration) int64

Adds a duration to the given unix time in nanoseconds.

func CurrTime

func CurrTime() time.Time

Returns the time by calling TimeFunc.

func CurrTimeUnixNano

func CurrTimeUnixNano() int64

Returns the time as Unix time in nanoseconds by calling TimeFunc.

Types

This section is empty.

Jump to

Keyboard shortcuts

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