Sha256: 6ebae4d7322be853a9026b5410a3dde4decf019f7bbfe893ded45dbdbefe5d2e
Contents?: true
Size: 323 Bytes
Versions: 14
Compression:
Stored size: 323 Bytes
Contents
require 'lightio' start = Time.now beams = 1000.times.map do # LightIO::Beam is a thread-like executor, use it instead Thread LightIO::Beam.new do # do some io operations in beam LightIO.sleep(1) end end beams.each(&:join) seconds = Time.now - start puts "1000 beams take #{seconds - 1} seconds to create"
Version data entries
14 entries across 14 versions & 1 rubygems