mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Simplified, faster implementation of Benchmark.realtime [Alexander Dymo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
6d39d05269
commit
95af46861a
1 changed files with 12 additions and 0 deletions
12
activesupport/lib/active_support/core_ext/benchmark.rb
Normal file
12
activesupport/lib/active_support/core_ext/benchmark.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
require 'benchmark'
|
||||
|
||||
module Benchmark
|
||||
remove_method :realtime
|
||||
def realtime
|
||||
r0 = Time.now
|
||||
yield
|
||||
r1 = Time.now
|
||||
r1.to_f - r0.to_f
|
||||
end
|
||||
module_function :realtime
|
||||
end
|
Loading…
Reference in a new issue