Last active
August 29, 2015 14:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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