Inefficient Process Polling #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
show_progress() {
while ps -p $pid > /dev/null; do
sleep $delay
Optimization: This polls every 0.1s. Use wait with timeout instead:
while kill -0 $pid 2>/dev/null; do
# spinner logic
sleep $delay
done