/gsleep

sleep command accepting Go duration syntax.

Primary LanguageGoMIT LicenseMIT

gsleep

sleep command accepting Go duration syntax.

Installation

go install github.com/forestgagnon/gsleep@latest

Usage

# Sleep 5 minutes
gsleep 5m

# Sleep 3 hours and 20 minutes
gsleep 3h20m && say check on that thing

Omit units for backwards-compatible mode with sleep

# Sleep 3 seconds
gsleep 3

Duration syntax

https://pkg.go.dev/time#ParseDuration

ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".