From 95af46861a80463833081c049f3a723e90c7ec01 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sat, 2 Feb 2008 01:53:58 +0000 Subject: Simplified, faster implementation of Benchmark.realtime [Alexander Dymo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/benchmark.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 activesupport/lib/active_support/core_ext/benchmark.rb (limited to 'activesupport') 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 -- cgit v1.2.3