sleep(1p) equivalent #83

Open
opened 2024-03-22 14:48:37 +00:00 by trinity · 0 comments
Owner

sleep(1p) pauses for a certain number of seconds, usually using the sleep(2) UNIX system call, which blocks a given number of seconds. It's useful for shell scripts (while true; do test -e file && break || sleep 1; done checks for a file at one-second intervals, for example).

Should equivalent functionality be implemented in Bonsai? How?

I was bored and already implemented sleep(1p) in Rust, using std::thread::sleep(), based on a program I did in C. This is without extensions (unit suffixes are popular but not necessary; rpn 5 60 '*' | xargs sleep does 5 minutes, for example).

sleep(1p) pauses for a certain number of seconds, usually using the sleep(2) UNIX system call, which blocks a given number of seconds. It's useful for shell scripts (`while true; do test -e file && break || sleep 1; done` checks for a file at one-second intervals, for example). Should equivalent functionality be implemented in Bonsai? How? I was bored and already [implemented sleep(1p) in Rust](https://git.tebibyte.media/bonsai/coreutils/src/branch/sleep/src/sleep.rs), using `std::thread::sleep()`, based on [a program I did in C](https://git.tebibyte.media/trinity/src/src/commit/6ca7b9e61295477aa483bb98a18aca8b6a04e842/sleep/sleep.c). This is without extensions (unit suffixes are popular but not necessary; `rpn 5 60 '*' | xargs sleep` does 5 minutes, for example).
trinity added the
enhancement
question
labels 2024-03-22 14:49:22 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bonsai/coreutils#83
No description provided.