Permalink
Browse files

r1612@asus: jeremy | 2005-07-03 04:35:59 -0700

 don't include Benchmark into AbstractAdapter directly.  call Benchmark.realtime instead of bm = Benchmark.measure, bm.real


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1630 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
jeremy committed Jul 3, 2005
1 parent 45c4b07 commit 5bc1e39b35da6ed7eaef8e215c57c75acb154f76
Showing with 3 additions and 5 deletions.
  1. +3 −5 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -258,8 +258,6 @@ def simplified_type(field_type)
class AbstractAdapter
@@row_even = true
- include Benchmark
-
def initialize(connection, logger = nil) # :nodoc:
@connection, @logger = connection, logger
@runtime = 0
@@ -397,9 +395,9 @@ def log(sql, name)
if block_given?
if @logger and @logger.level <= Logger::INFO
result = nil
- bm = measure { result = yield }
- @runtime += bm.real
- log_info(sql, name, bm.real)
+ seconds = Benchmark.realtime { result = yield }
+ @runtime += seconds
+ log_info(sql, name, seconds)
result
else
yield

0 comments on commit 5bc1e39

Please sign in to comment.