diff --git a/atom b/atom index f2f6619..2bf93a4 100755 --- a/atom +++ b/atom @@ -2052,16 +2052,15 @@ do checkworkers cleaner master - if ((taskcount - remaining)) + if (( ran )) then currenttime=$(date +%s) - secsremaining=$(( - remaining - * - (currenttime - starttime) + avgduration=$(( + ((currenttime - starttime) * 1000) / - (taskcount - remaining) + ran )) + secsremaining=$(( remaining * avgduration / 1000 )) (( days = secsremaining / @@ -2077,12 +2076,28 @@ do / 60 )) || true + (( seconds = + secsremaining + - + ( ( ( ( days*24 + hours ) *60 ) + minutes ) *60 ) + )) || true + avgduration=$(printf %04i $avgduration) + avgdsec=${avgduration:0:-3} + avgdmsec=${avgduration#$avgdsec} fi - echo -en "\rload: $humanload / $maxload" \ - "workers: $active / $concurrency" \ - "done: $(( ran * 100 / taskcount ))%" \ - "- ${ran:-0} of $taskcount ($failed failed)" \ - "${days}d ${hours}h${minutes}m\c" + dran=$(printf %${#taskcount}i ${ran:-0}) + rtime=$( + printf '%2id %2ih%02im%02is' \ + ${days:-0} \ + ${hours:-0} \ + ${minutes:-0} \ + ${seconds:-0} + ) + percent=$(printf %3i $((ran * 100 / taskcount))) + echo -en "\rL: $humanload/$maxload" \ + "W: $active/$concurrency" \ + "T: ${dran}/$taskcount (F:$failed) $percent% $rtime" \ + "(A: ${avgdsec:--}.${avgdmsec:--}s/task)" done unset count