dtime

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElapsedTime

func ElapsedTime(since time.Time) int64

Time in millliseconds elapsed since a time

func MsPrecision

func MsPrecision(t *time.Time) time.Time

func MsToTime

func MsToTime(msInt int64) time.Time

func Now

func Now() time.Time

func NowMs

func NowMs() int64

func SetNowProvider

func SetNowProvider(provider func() time.Time) func()

Visible for testing Returns the reset function to restore the default provider

func SetNowProviderValues

func SetNowProviderValues(value ...time.Time) func()

Visible for testing It will mock the now provider to return each element of the slice The last element will be returned if there are no more elements Returns the reset function to restore the default provider Will panic if the slice is empty

func TimeToMs

func TimeToMs(t *time.Time) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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