Skip to content

Instantly share code, notes, and snippets.

@Voker57
Forked from anonymous/gist:111067
Created May 13, 2009 15:08
Show Gist options
  • Save Voker57/111075 to your computer and use it in GitHub Desktop.
Save Voker57/111075 to your computer and use it in GitHub Desktop.
require 'benchmark'
include Benchmark
n = 10000000
Benchmark.bm do |test|
test.report("Double quotes:") do
n.times do |x|
str = "A string without newline"
end
end
test.report("Single quotes:") do
n.times do |x|
str = 'A string without newline'
end
end
end
# user system total real
# Double quotes: 6.120000 2.030000 8.150000 ( 8.299323)
# Single quotes: 6.080000 2.170000 8.250000 ( 8.286099)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment