Last active
November 2, 2016 13:49
-
-
Save Nakilon/f317c4975a1e8dc99f85dda8a955d9fb to your computer and use it in GitHub Desktop.
the most straight code perfomance comparison ever, lol
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
# either run it in irb or .join some thread to prevent program exit | |
i = 0 | |
Thread.new do | |
puts i while sleep 1 | |
end | |
Thread.new do | |
loop{ i += 1 } | |
end | |
Thread.new do | |
loop{ i -= 1 } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe have a winner if it ever reaches -100 or 100