Sha256: aaf08c6aa413401f2247179ce3db47c51b7dff9db003f658a7e13d9fc11f7849
Contents?: true
Size: 348 Bytes
Versions: 1
Compression:
Stored size: 348 Bytes
Contents
# # for example, this takes only 4 seconds or so to complete (8 iterations # running in two processes = twice as fast) # require 'forkoff' a = Time.now.to_f results = (0..7).forkoff do |i| sleep 1 i ** 2 end b = Time.now.to_f elapsed = b - a puts "elapsed: #{ elapsed }" puts "results: #{ results.inspect }"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
forkoff-0.0.1 | samples/b.rb |