Skip to content

Commit

Permalink
Improve code template in README.md (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
amomchilov committed Aug 29, 2024
1 parent 6c0a6bf commit bfdf58d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ require 'benchmark/ips'
Benchmark.ips do |x|
# Configure the number of seconds used during
# the warmup phase (default 2) and calculation phase (default 5)
x.config(:time => 5, :warmup => 2)

# These parameters can also be configured this way
x.time = 5
x.warmup = 2
x.config(warmup: 2, time: 5)

# Typical mode, runs the block as many times as it can
x.report("addition") { 1 + 2 }
Expand All @@ -43,8 +39,9 @@ Benchmark.ips do |x|
x.report("addition2") do |times|
i = 0
while i < times
1 + 2
i += 1

1 + 2
end
end

Expand Down

0 comments on commit bfdf58d

Please sign in to comment.