in reply to Re: Time::HiRes strange behavior
in thread Time::HiRes strange behavior
It's all down to the buffering done by the pipe.As far as I know how pipes work this is not entirely correct.
Consider a stripped down version of your pipeline:
perl -MTime::HiRes=gettimeofday -e '$|++; print gettimeofday() . "\n" +while sleep 1' |\ perl -MTime::HiRes=gettimeofday -e '$|++; print gettimeofday() . " " . + $_ while <>'
Using this stripped pipeline you won't see any serious buffering related delay. Here's the why: If the process at the write end writes any amount (less then the pipe buffer) to the pipe, then the process at the read end will be able to read it irrespectively the state of the pipe buffer. If you omit the commands with possibly buffered output in your pipeline, you won't get the buffer filling delay. I think the result you showed us is caused by your version of tee (or less likely tail), by using buffered output. (I cannot see the same results with the current GNU versions of tee and tail.)
Of course the pipe buffer can cause delays: if the buffer is empty then the reads will block, if the buffer is full then the writes will block. But reads will not block just because the buffer is not full.
So in my comprehension your delayed results are all down to output buffering but not to pipe buffering.