I have a loop that runs for a variable amount of time, as defined by @duration. I need to re-execute the command every 15 seconds for the
length of @duration, which is a float and can have any value. Can
anyone think of a more elegant way to do this than the code below?
I don't know about elegant, but it's a little more easy to read
sleep [15, end_time - t].min
than the ?: business.
···
On 28/09/2007, Earle Clubb <eclubb@valcom.com> wrote:
I have a loop that runs for a variable amount of time, as defined by @duration. I need to re-execute the command every 15 seconds for the
length of @duration, which is a float and can have any value. Can
anyone think of a more elegant way to do this than the code below?
I have a loop that runs for a variable amount of time, as defined by @duration. I need to re-execute the command every 15 seconds for the
length of @duration, which is a float and can have any value. Can
anyone think of a more elegant way to do this than the code below?
I have a loop that runs for a variable amount of time, as defined by @duration. I need to re-execute the command every 15 seconds for the
length of @duration, which is a float and can have any value. Can
anyone think of a more elegant way to do this than the code below?