Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (25 sloc) 0.357 kB
require 'benchmark'
class User; end
module Runner
refine User do
def run
Math.tan(Math::PI / 4)
end
end
end
class Context
using Runner
def self.call
user = User.new
user.run
end
end
Benchmark.bm do |bench|
3.times do
bench.report('refine') do
1000000.times do
Context.call
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.