Permalink
Browse files

Simplified, faster implementation of Benchmark.realtime [Alexander Dymo]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 6d39d05 commit 95af46861a80463833081c049f3a723e90c7ec01 @NZKoz NZKoz committed Feb 2, 2008
Showing with 12 additions and 0 deletions.
  1. +12 −0 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.