Sha256: c85538dcd4487b7cc9ac2f10fecff337e5ddd844d793190a913c22e4c0458ceb

Contents?: true

Size: 458 Bytes

Versions: 6

Compression:

Stored size: 458 Bytes

Contents

require 'win32ole'
require 'benchmark'

COUNT = (ARGV[0] || 250).to_i
ITERATIONS = (ARGV[1] || 20).to_i

dir = 'C:/opt/test_data'
fso = WIN32OLE.new('Scripting.FileSystemObject')
drives = fso.GetFolder(dir).Files

total = 0.0
ITERATIONS.times do
  printf "drives.each #{COUNT} of 120 calls: "
  time = Benchmark.measure {
    COUNT.times do 
      drives.each {|d| }
    end
  }
  puts time
  total += time.real
end
#sleep 1000

puts "Total time = #{total}"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jruby-win32ole-0.8.5 samples/dir_enum_bench.rb
jruby-win32ole-0.8.4 samples/dir_enum_bench.rb
jruby-win32ole-0.8.3 samples/dir_enum_bench.rb
jruby-win32ole-0.8.2 samples/dir_enum_bench.rb
jruby-win32ole-0.8.1 samples/dir_enum_bench.rb
jruby-win32ole-0.8.0 samples/dir_enum_bench.rb