Concurrent computing
var a = <Enjoy Rosetta Code>
a.map{|str|
{ Sys.sleep(1.rand)
say str
}.fork
}.map{|thr| thr.wait }Output:
Enjoy
Code
RosettaLast updated
var a = <Enjoy Rosetta Code>
a.map{|str|
{ Sys.sleep(1.rand)
say str
}.fork
}.map{|thr| thr.wait }Enjoy
Code
RosettaLast updated