Help us shape the future of Go! Take the 2026 Go Developer Survey

sleep

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sleep implements the `sleep` built-in.

Accepted durations:

123      -> 123 seconds
123s     -> 123 seconds
5m       -> 5 minutes
2h       -> 2 hours
1d       -> 1 day
0.5      -> 500 milliseconds (fractional values allowed)

Multiple operands are summed (matching coreutils). The actual wait goes through Context.Sleep when non-nil so tests can elide the wall-clock delay; otherwise we use time.Sleep guarded by ctx.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() command.Command

New returns the sleep command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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