Simplest way to measure time taken by a function