samples/b.rb in forkoff-0.0.0 vs samples/b.rb in forkoff-0.0.1
- old
+ new
@@ -1,19 +1,17 @@
#
-# for example, this takes only 1 second or so to complete
+# 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