Sha256: 27d69450d35247fb1552b8d4b4844fd6b9fc723dffab626fd16f731c9ed2d78a
Contents?: true
Size: 542 Bytes
Versions: 5
Compression:
Stored size: 542 Bytes
Contents
module LightIO::Library module KernelExt def sleep(*duration) if duration.size > 1 raise ArgumentError, "wrong number of arguments (given #{duration.size}, expected 0..1)" elsif duration.size == 0 LightIO::IOloop.current.transfer end duration = duration[0] if duration.zero? && LightIO::Beam.current.respond_to?(:pass) LightIO::Beam.current.pass return end timer = LightIO::Watchers::Timer.new duration LightIO::IOloop.current.wait(timer) end end end
Version data entries
5 entries across 5 versions & 1 rubygems