Skip to content

Instantly share code, notes, and snippets.

@jamesgolick
Created March 16, 2010 18:47
Show Gist options
  • Save jamesgolick/334347 to your computer and use it in GitHub Desktop.
Save jamesgolick/334347 to your computer and use it in GitHub Desktop.
>> puts Benchmark.measure { 1000.times { "abcdefg" =~ /a/ } }
0.000000 0.000000 0.000000 ( 0.000748)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg" =~ /a/ } }
0.000000 0.000000 0.000000 ( 0.000743)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg" =~ /a/ } }
0.000000 0.000000 0.000000 ( 0.000715)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg" =~ /a/ } }
0.000000 0.000000 0.000000 ( 0.000659)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg" =~ /a/ } }
0.000000 0.000000 0.000000 ( 0.000711)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg".match /a/ } }
0.000000 0.000000 0.000000 ( 0.001304)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg".match /a/ } }
0.000000 0.000000 0.000000 ( 0.001285)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg".match /a/ } }
0.000000 0.000000 0.000000 ( 0.001280)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg".match /a/ } }
0.000000 0.000000 0.000000 ( 0.001386)
=> nil
>> puts Benchmark.measure { 1000.times { "abcdefg".match /a/ } }
0.000000 0.000000 0.000000 ( 0.001342)
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment