Philip Rowlands wrote:
> On Fri, 18 Sep 2009, Pádraig Brady wrote:
> 
>> Pádraig Brady wrote:
>>> sleep $(seq .1 .1 4 | head -n $(($RANDOM%40 +1)) | tail -n1)
>>
>> Or more concisely using just coreutils logic:
>>
>> sleep $(seq .1 .1 4 | shuf | head -n1)
> 
> This still has the quantization effects which I'm trying to avoid. Jim's
> perl suggestion would work well to ensure an even spread over the window
> of time.
> 
> $ perl -e 'sleep rand 4'
> 
> is probably the cleanest / most efficient way to do this with existing
> tools.

right.

Note the scheduler is still going to quantize your sleep values,
so in practicality your probably not going to get smoother than:

  sleep $(seq .002 .002 4 | shuf | head -n1)

cheers,
Pádraig.

p.s. That's another use case for sort --range


Reply via email to