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