3 ms·
Not really equivalent since it does not involve an event reactor, only context switching: X = 1_000_000 f = Fiber.new do loop { Fiber.yield }
by ciconia 8y ago
Not really equivalent since it does not involve an event reactor, only context switching:
X = 1_000_000
f = Fiber.new do
loop { Fiber.yield }
end
t0 = Time.now
X.times { f.resume }
dt = Time.now - t0
puts "#{X / dt.to_f}/s"
~ 780K on my machine