Browse files

Use Benchmark.realtime for Pry `time` helper method

  • Loading branch information...
1 parent 7d9bda8 commit f86d798c4cc6018537228f8633c7b7ba8aaafdef @mdespuits committed Mar 2, 2014
Showing with 2 additions and 6 deletions.
  1. +2 −6 pryrc
View
8 pryrc
@@ -156,13 +156,9 @@ end
# Display execution timing
def time(&b)
require 'benchmark'
- res = nil
- timing = Benchmark.measure do
- res = yield
+ Benchmark.realtime do
+ yield
end
- puts "Using yield, it took: user system total real"
- puts " #{timing}"
- res
end
# Display which computer is in use

0 comments on commit f86d798

Please sign in to comment.