Ruby Threading

Thread.new{}
2.times do |i|    Thread.new {        10000000.times do |t|        t + 1        end        ending = Time.now        elapsed = ending - starting        puts ("#{i} End:" + elapsed.to_s)     }endending = Time.nowelapsed = ending - startingputs ("Main End:" + elapsed.to_s)
x = Thread.new{}
x.join

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store