Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/xlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2015-12-09 19:30:00 +0300
committerSoumith Chintala <soumith@gmail.com>2015-12-09 19:30:00 +0300
commitbe54d0cfc910845e7a7a674bff63dec487fc2d4c (patch)
treeeb895e8275bba2c735b3627945bf9ca74349b970
parent2605c23777e825d96085e5b8394afbe8960db5a3 (diff)
parenta37ffac6ca9aac8f99c4079b163799be9ec682b9 (diff)
Merge pull request #13 from lucasb-eyer/master
Progress show total time when done. (vs ETA: 0ms)
-rw-r--r--init.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index b30829d..7e59d34 100644
--- a/init.lua
+++ b/init.lua
@@ -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, ' ')