Skip to content

Instantly share code, notes, and snippets.

@luislavena
Created November 2, 2010 20:02
Show Gist options
  • Save luislavena/660199 to your computer and use it in GitHub Desktop.
Save luislavena/660199 to your computer and use it in GitHub Desktop.
>ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
>timer ruby -rwin32console test.rb
real 11.299
system 1.185
user 2.480
>ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
>timer ruby test.rb
real 9.240
system 0.904
user 0.608
class String
def red
"\e[31m#{self}\e[0m"
end
def yellow
"\e[33m#{self}\e[0m"
end
def green
"\e[32m#{self}\e[0m"
end
end
def output
10_000.times do
print "E".red, "*".yellow, ".".green
end
end
output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment