diff options
author | Soumith Chintala <soumith@gmail.com> | 2015-12-09 19:30:00 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2015-12-09 19:30:00 +0300 |
commit | be54d0cfc910845e7a7a674bff63dec487fc2d4c (patch) | |
tree | eb895e8275bba2c735b3627945bf9ca74349b970 | |
parent | 2605c23777e825d96085e5b8394afbe8960db5a3 (diff) | |
parent | a37ffac6ca9aac8f99c4079b163799be9ec682b9 (diff) |
Merge pull request #13 from lucasb-eyer/master
Progress show total time when done. (vs ETA: 0ms)
-rw-r--r-- | init.lua | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -282,8 +282,13 @@ do indices = table.splice(indices) times = table.splice(times) end - tm = 'ETA: ' .. formatTime(remaining) .. ' | Step: ' .. formatTime(step) - io.write(tm) + -- Print remaining time when running or total time when done. + if (percent < barLength) then + io.write('ETA: ' .. formatTime(remaining)) + else + io.write('Tot: ' .. formatTime(elapsed)) + end + io.write(' | Step: ' .. formatTime(step)) -- go back to center of bar, and print progress for i=1,6+#tm+barLength/2 do io.write('\b') end io.write(' ', current, '/', goal, ' ') |