ruby--ruby/benchmark/bm_io_file_read.rb

16 lines
171 B
Ruby
Raw Normal View History

#
# Seek and Read file.
#
require 'tempfile'
max = 20_000
str = "Hello world! " * 1000
f = Tempfile.new('yarv-benchmark')
f.write str
max.times{
f.seek 0
f.read
}