Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: L A Walsh Newsgroups: gnu.bash.bug Subject: Re: Add sleep builtin Date: Tue, 21 Aug 2018 18:11:14 -0700 Lines: 29 Approved: bug-bash@gnu.org Message-ID: References: <83513822-23BF-4695-9542-F967512A8A3D@gmail.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1534900413 6550 208.118.235.17 (22 Aug 2018 01:13:33 GMT) X-Complaints-To: action@cs.stanford.edu Cc: konsolebox , bug-bash To: Clint Hepner Envelope-to: bug-bash@gnu.org User-Agent: Thunderbird In-Reply-To: <83513822-23BF-4695-9542-F967512A8A3D@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 173.164.175.65 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14521 Clint Hepner wrote: >> On Aug 19, 2018, at 10:25 AM, konsolebox wrote: >> >> Hi Chet, >> >> The sleep command is often used in loops and using the external sleep >> is expensive. >> > > Expensive is relative, as the time spent actually sleeping probably dwarfs the startup time. If not, you probably want to find an alternative to polling anyway. > If he implements sleep with the floating point option then the above might not be true: sleep .001 (ms sleep)...not practical if loaded each time) I often use sleep .1/.3/.5 ... if the builtin doesn't support sleep times < 1 second, then it's probably not worth it. Also, needs to actually sleep for the listed time. I remember some implementations only wait till the clock reaches the new time in seconds -- meaning that the actual sleep time could be .001 seconds.