Created
November 2, 2010 20:02
-
-
Save luislavena/660199 to your computer and use it in GitHub Desktop.
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
>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 |
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
>ruby -v | |
ruby 1.9.2p0 (2010-08-18) [i386-mingw32] | |
>timer ruby test.rb | |
real 9.240 | |
system 0.904 | |
user 0.608 |
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
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