Skip to content

Commit a37ffac

Browse files
committed
Progress show total time when done. (vs ETA: 0ms)
1 parent 2605c23 commit a37ffac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

init.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,13 @@ do
282282
indices = table.splice(indices)
283283
times = table.splice(times)
284284
end
285-
tm = 'ETA: ' .. formatTime(remaining) .. ' | Step: ' .. formatTime(step)
286-
io.write(tm)
285+
-- Print remaining time when running or total time when done.
286+
if (percent < barLength) then
287+
io.write('ETA: ' .. formatTime(remaining))
288+
else
289+
io.write('Tot: ' .. formatTime(elapsed))
290+
end
291+
io.write(' | Step: ' .. formatTime(step))
287292
-- go back to center of bar, and print progress
288293
for i=1,6+#tm+barLength/2 do io.write('\b') end
289294
io.write(' ', current, '/', goal, ' ')

0 commit comments

Comments
 (0)