Sha256: 5b5b584675e2053a42e20c75c2294525dade96f8f4a9845e9937c211d088bf5b

Contents?: true

Size: 452 Bytes

Versions: 5

Compression:

Stored size: 452 Bytes

Contents

require_relative '../../lib/tty-progressbar'

bars = TTY::ProgressBar::Multi.new

bar1 = bars.register "foo [:bar] :percent", total: 20
bar2 = bars.register "bar [:bar] :percent", total: 30
bar3 = bars.register "baz [:bar] :percent", total: 10

th1 = Thread.new { 20.times { sleep(0.2); bar1.advance } }
th2 = Thread.new { 30.times { sleep(0.1); bar2.advance } }
th3 = Thread.new { 10.times { sleep(0.3); bar3.advance } }

[th1, th2, th3].each(&:join)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tty-progressbar-0.17.0 examples/multi/simple.rb
tty-progressbar-0.16.0 examples/multi/simple.rb
tty-progressbar-0.15.1 examples/multi/simple.rb
tty-progressbar-0.15.0 examples/multi/simple.rb
tty-progressbar-0.14.0 examples/multi/simple.rb