[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coreutils] slimmer alternative to sleep command?
From: |
Ralf Wildenhues |
Subject: |
Re: [coreutils] slimmer alternative to sleep command? |
Date: |
Sat, 24 Jan 2009 18:40:19 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello Chris,
* Chris Jones wrote on Sat, Jan 24, 2009 at 06:36:32PM CET:
> Given a bash script that runs an infinite loop such as:
>
> do forever:
> get data
> print data
> sleep 1
> done
>
> I was wondering if I could avoid the overhead of starting and
> terminating the sleep child process by using a different strategy.
Try not polling, but just waiting for the producer of the data to be
ready. Maybe your script can read a token (or the data itself) from a
pipe, and the producer write to the pipe?
Cheers,
Ralf