use benchmark to time a function in ruby