aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/core_ext/benchmark.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/benchmark.rb b/activesupport/lib/active_support/core_ext/benchmark.rb
new file mode 100644
index 0000000000..98e61e646a
--- /dev/null
+++ b/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 \ No newline at end of file