Ruby concurrency

From wikinotes

Documentation

thread docs https://docs.ruby-lang.org/en/2.7.0/Thread.html

Thread

def func1
   i = 0
   while i<=2
      puts "func1 at: #{Time.now}"
      sleep(2)
      i = i+1
   end
end

thread = Thread.new{func1()}
thread.join()