Paste this method into your console:
def time(&block) puts Benchmark.measure(&block) end
Now time { Some.lengthy_task }
will behave similar to the bash time
command. Of course you can do much more with the Benchmark object than just puts
ing it – adapt to your needs.
Posted by Dominik Schöler to makandra dev (2013-12-13 15:58)