timep

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: BSD-3-Clause Imports: 2 Imported by: 14

README

time

Plus to the standard "time" package.

// SleepUntil sleeps until the specified time.
func SleepUntil(t time.Time) {}

LICENSE

BSD license

Documentation

Index

Constants

View Source
const (
	Day  = 24 * time.Hour
	Week = 7 * Day
)

Variables

This section is empty.

Functions

func SleepUntil

func SleepUntil(t time.Time)

SleepUntil sleeps until the specified time.

func SleepUntilWithCancel

func SleepUntilWithCancel(ctx context.Context, t time.Time) error

SleepUntilWithCancel sleep until a specify time and returns nil, unless the context is cancelled, in which case ctx.Err() is returned.

Types

type NowFunc

type NowFunc func() time.Time

NowFunc has the signature of time.Now().

func PresetNow

func PresetNow(t time.Time) NowFunc

PresetNow Returns a NowFunc which returns the specific time.

Jump to

Keyboard shortcuts

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