From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1951 invoked by alias); 2 Sep 2013 02:33:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31683 Received: (qmail 97 invoked from network); 2 Sep 2013 02:33:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at spodhuis.org does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=SkovuCBRkzl7RotwRqXjNMw6XBebZQqQHnRdTouVnW4=; b=HOQu9M/EAenmrB3E356MlW1XYSJdnC07IEkJeDRAgTzi2sU/FMJrv23b5/lsQPCw5oVdLKhQXcMa2dQEgDiS9HHzbB5rrE9qHiNf/AiOEnLF4b3o5POLacFdZXfzQt1PtcuC1AU4EYKHX5UkmnEDTXdmLVljC82P4CcAVZoHFRI=; Date: Sun, 1 Sep 2013 19:33:40 -0700 From: Phil Pennock To: zsh-workers@zsh.org Subject: Re: sleep $floatval Message-ID: <20130902023340.GA14105@redoubt.spodhuis.org> Mail-Followup-To: zsh-workers@zsh.org References: <20130831234733.GA83723@redoubt.spodhuis.org> <20130901182926.2ad24eb4@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130901182926.2ad24eb4@pws-pc.ntlworld.com> On 2013-09-01 at 18:29 +0100, Peter Stephenson wrote: > On Sat, 31 Aug 2013 16:47:33 -0700 > Phil Pennock 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 " 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" 2. "AARGH BY THE OLD ONES HELL NO!" ? Thanks, -Phil