From bfdf58d52232d3a1bc16079ab6a094d23868372a Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Thu, 29 Aug 2024 18:48:24 -0400 Subject: [PATCH] Improve code template in README.md (#140) --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5404ba9..ef030de 100644 --- a/README.md +++ b/README.md @@ -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 } @@ -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