Skip to content

Instantly share code, notes, and snippets.

@edwardloveall
Last active August 29, 2015 14:10
Show Gist options
  • Save edwardloveall/c5c2cb08bbbaea16d26f to your computer and use it in GitHub Desktop.
Save edwardloveall/c5c2cb08bbbaea16d26f to your computer and use it in GitHub Desktop.
Trying out multiple threads to see how printing multiple things to the screen at the same time might work
require 'colored'
christmas = Thread.new do
1.upto(10) do
print "Christmas\n".green
sleep(1)
end
end
merry = Thread.new do
1.upto(20) do
print "Merry\n".red
sleep(0.5)
end
end
christmas.join
merry.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment