Created
May 10, 2010 02:12
-
-
Save bry4n/395586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user system total real | |
unless 0.520000 0.150000 0.670000 ( 0.677782) | |
if not 0.520000 0.150000 0.670000 ( 0.672080) | |
if ! 0.520000 0.180000 0.700000 ( 0.691658) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
interval = 1_000_000 | |
val = false | |
Benchmark.bm(25) do |x| | |
x.report("unless") { interval.times { true unless val } } | |
x.report("if not") { interval.times { true if not val } } | |
x.report("if !") { interval.times { true if !val } } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment