File: benchmark.rb

package info (click to toggle)
ruby-progressbar 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 840 kB
  • sloc: ruby: 2,958; sh: 29; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# bundle exec ruby-prof --printer=graph_html
#                       --file=../results.html
#                       --require 'ruby-progressbar'
#                       --sort=total ./spec/fixtures/benchmark.rb

total  = 100_000
# output = File.open('/Users/jfelchner/Downloads/benchmark.txt', 'w+')
output = $stdout

# Progressbar gem
# bar = ProgressBar.new('Progress', total)
#
# total.times do |i|
#   bar.inc
# end
#
# bar.finish

# Ruby/ProgressBar
bar = ProgressBar.create(:output => output,
                         :length => 80,
                         :start  => 0,
                         :total  => total)

total.times do |_i|
  # bar.log i
  bar.increment
end