while wait && [[ $SECONDS -lt $1 ]]; do read -t $(($1 - SECONDS)) done <><(:)
{ wait; read -t $1; } <><(:)
Interestingly, it does reap on a blocked read without -t, so potentially the behaviour on -t would be considered a bug rather than as-designed.
There's also a loadable sleep builtin supplied with bash which calls into the internal fsleep() so should be reliable and without forking.
Interestingly, it does reap on a blocked read without -t, so potentially the behaviour on -t would be considered a bug rather than as-designed.
There's also a loadable sleep builtin supplied with bash which calls into the internal fsleep() so should be reliable and without forking.