Created
December 31, 2011 01:39
-
-
Save tarcieri/1542400 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comment this out on JRuby 1.6.5 and the example will "work" long enough to break | |
# require 'fiber' is broken on JRuby 1.6.5 | |
require 'fiber' | |
started_at = Time.now | |
100000.times do |n| | |
if n % 1000 == 0 | |
time = Time.now | |
puts "#{n} fibers (#{"%0.3f" % (time - started_at)} seconds)" | |
started_at = time | |
end | |
Fiber.new { }.resume | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment