Skip to content

Instantly share code, notes, and snippets.

@bostwick
Created November 7, 2013 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bostwick/8ee1d4df9c7743f9efed to your computer and use it in GitHub Desktop.
Save bostwick/8ee1d4df9c7743f9efed to your computer and use it in GitHub Desktop.
Timing HelloWorld in Java, Ruby and Python
[daniel@Daniel-Bostwicks-MacBook-Pro Sandbox]$ time java -client HelloWorld
Hello World!
real 0m0.182s
user 0m0.204s
sys 0m0.029s
[daniel@Daniel-Bostwicks-MacBook-Pro Sandbox]$ time ruby hello_world.rb
Hello World!
real 0m0.023s
user 0m0.019s
sys 0m0.004s
[daniel@Daniel-Bostwicks-MacBook-Pro Sandbox]$ time python hello_world.py
Hello World!
real 0m0.067s
user 0m0.056s
sys 0m0.010s
[daniel@Daniel-Bostwicks-MacBook-Pro Sandbox]$ cat HelloWorld.java hello_world.rb hello_world.py
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
puts "Hello World!"
print "Hello World!"
[daniel@Daniel-Bostwicks-MacBook-Pro Sandbox]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment