From: "Jesús Gabriel y Galán" Date: 2010-12-01T01:15:59+09:00 Subject: Re: 'require' is not recognised On Tue, Nov 30, 2010 at 5:00 PM, Tara Keane wrote: > thanks for your help - I had forgotten to include benchmark inside > quotes so it wasn't picking it up. > one more quick question... > > require'benchmark' > iterations = 100000 > a=Benchmark.measure do >  for i in 1..iterations do >  x=i >  end > end > > In the above code (from Beginning Ruby book) > what's the difference between benchmark and Benchmark(uppercase) I recommend you read an introduction to Ruby (there are some useful links here: http://www.ruby-lang.org/en/documentation/). When you do require 'benchmark', the require method would search for a suitable file in the load path (benchmark.rb, benchmark.so, etc depending on the OS). When it finds the file, it loads its contents and execute them. In this case, the benchmark.rb file creates a constant called Benchmark, which you can then use. It has a method measure you can call and so on. > Also why 2 periods 1..iterations? a..b is a Range literal. That for syntax executes the block once for each value between 1 and iterations. Take a look at Ranges to understand. By the way, I prefer to do this kind of things like this: iterations = 100000 iterations.times do # your code end Jesus.