I’ve seen a lot of blogs where authors discuss throwing together quick benchmark tests, like this Ruby 1.9.0 v Python 2.5.1 that Antonio Cangiano “throws together at 3am.”
Is there a simple way to time a script to the millisecond like that that I’m unaware of? Is he probably using built-in functions of OS X or individual libraries? Does Python have a standard lib for this?
How would you do this if you were just going to take the path of least resistance and throw it together at 3am?
If you’re after mere benchmarking, and you’re not too worried about start-up time, and you want it to be programming language independent and you’re on Unix, you’d probably use unix
time: