Skip to content

Commit

Permalink
Simplified, faster implementation of Benchmark.realtime [Alexander Dymo]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
NZKoz committed Feb 2, 2008
1 parent 6d39d05 commit 95af468
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions activesupport/lib/active_support/core_ext/benchmark.rb
@@ -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

0 comments on commit 95af468

Please sign in to comment.