Skip to content

Instantly share code, notes, and snippets.

@Nakilon Nakilon/plus_vs_minus.rb
Last active Nov 2, 2016

Embed
What would you like to do?
the most straight code perfomance comparison ever, lol
# 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
@jaccokee

This comment has been minimized.

Copy link

commented Nov 2, 2016

Maybe have a winner if it ever reaches -100 or 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.