Skip to content

✨ Add sleep tool for Windows - #20

Merged
mandus merged 1 commit into
mainfrom
feat/009-sleep-command
Aug 9, 2026
Merged

mandus merged 1 commit into
mainfrom
feat/009-sleep-command

Conversation

@mandus

@mandus mandus commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Windows ships no sleep(1), so goal's run"sleep""2" fails on %PATH% lookup. The usual substitutes are all unusable here: timeout /t is integer-only and aborts with "Input redirection is not supported" whenever stdin is not a console, ping -n abuses the network stack for integer seconds, and PowerShell's Start-Sleep costs a few hundred ms of interpreter startup per call.

A 13 KB C binary avoids all of that and adds fractional seconds plus the GNU s/m/h/d suffixes. The POSIX nanosleep path exists only so the source builds and can be tested off Windows.

Windows ships no sleep(1), so goal's `run"sleep""2"` fails on %PATH%
lookup. The usual substitutes are all unusable here: `timeout /t` is
integer-only and aborts with "Input redirection is not supported"
whenever stdin is not a console, `ping -n` abuses the network stack for
integer seconds, and PowerShell's Start-Sleep costs a few hundred ms of
interpreter startup per call.

A 13 KB C binary avoids all of that and adds fractional seconds plus the
GNU s/m/h/d suffixes. The POSIX nanosleep path exists only so the source
builds and can be tested off Windows.
@mandus
mandus merged commit cbc57ba into main Aug 9, 2026
1 check passed
@mandus
mandus deleted the feat/009-sleep-command branch August 9, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant