xtime

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package xtime contains extensions to the standard library package time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SleepContext

func SleepContext(ctx context.Context, d time.Duration) error

SleepContext pauses the current goroutine for at least the duration d and returns nil, unless ctx expires in the mean time in which case it returns ctx.Err().

A negative or zero duration causes SleepContext to return nil immediately.

If there is less than d left until ctx's deadline, returns DeadlineTooSoonError immediately.

Types

type DeadlineTooSoonError

type DeadlineTooSoonError struct {
	// contains filtered or unexported fields
}

func (DeadlineTooSoonError) Error

func (err DeadlineTooSoonError) Error() string

Jump to

Keyboard shortcuts

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