Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: sleep $floatval

On 2013-09-01 at 18:29 +0100, Peter Stephenson wrote:
> On Sat, 31 Aug 2013 16:47:33 -0700
> Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> > What do folks think about sleep being a builtin, which can take
> > arbitrary formats and avoid forking an extra process, just to delay?
> You can use "zselect -t <hundredths>" to delay a number of 100ths of a second.
> (I think I added it before floating point was widely used in the shell.)
> It would also be easy to add a sleep subcommand to zsystem.

Crazy, idle, thought, to which a scream of horror might be the correct
response ...

Say I do add a zsleep command; if the sleep returns EINTR, then before
going back to sleep for the remainder of the duration, the command could
report on reaped jobs immediately, so that instead of being pre-prompt,
job termination could be reported immediately during the length of the
sleep.  (At which point, zsleep might as well take an option giving it a
function list variable to be be walked, any time it is woken up, to let
arbitrary handlers be invoked, before resuming sleep, and possibly with
a way to abort and avoid going back to sleep).

Does this make people go:

 1. "Hrm, interesting, that suggests some use-cases that might be neat"



Messages sorted by: Reverse Date, Date, Thread, Author