Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 1.1.5
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (16 sloc) 0.325 kb
require 'benchmark'
MAX = 10000
FILE = 'io_test_bench_file.txt'
File.open(FILE, 'w'){ |fh|
1000.times{ |n|
fh.puts "This is line: #{n}"
}
}
Benchmark.bmbm do |x|
10.times {
x.report('File.open(file, "r+")'){
MAX.times{ File.open(FILE, "r+") {} }
}
}
end
File.delete(FILE) if File.exists?(FILE)
Jump to Line
Something went wrong with that request. Please try again.