Skip to content

Commit

Permalink
Method to do quick benchmarks in IRb
Browse files Browse the repository at this point in the history
  • Loading branch information
amarshall committed Mar 3, 2012
1 parent 540e33e commit ec3cd61
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions irbrc
Expand Up @@ -65,6 +65,14 @@ class Object
end
end

def quickbm(repetitions = 100, &block)
require 'benchmark'

Benchmark.bm do |bm|
bm.report { repetitions.time &block }
end
end

if RUBY_PLATFORM.include? "darwin"
# Copy to OS X clipboard
def copy(str)
Expand Down

0 comments on commit ec3cd61

Please sign in to comment.