Inefficient Process Polling #7

Open
opened 2026-02-02 15:19:58 -05:00 by jared · 0 comments
Owner

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

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
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/proxDoc#7