Sha256: ddb6bc853bff8dbe079beb39f764ad713c5d7fbdfcbf1ee5fe61bd72c7f46a26
Contents?: true
Size: 414 Bytes
Versions: 4
Compression:
Stored size: 414 Bytes
Contents
#!/usr/bin/env ruby root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..')) lib_dir = File.join(root_dir,'lib') $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir) require 'benchmark' require 'combinatorics/cartesian_product' Benchmark.bm(13) do |b| [100, 200, 400, 800].each do |i| n = (1..i).to_a b.report("{#{i}} x {#{i}}") do n.cartesian_product(n).to_a end end end
Version data entries
4 entries across 4 versions & 1 rubygems