Permalink
Browse files

Dont benchmark if the logger has been turned off

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent dda5070 commit 577a22c47ea43365a81a92fc5ca20dd86c146ba7 @dhh dhh committed May 2, 2005
Showing with 2 additions and 0 deletions.
  1. +2 −0 actionpack/lib/action_view/helpers/benchmark_helper.rb
@@ -11,6 +11,8 @@ module BenchmarkHelper
#
# Will add something like "Notes section (0.345234)" to the log.
def benchmark(message = "Benchmarking", &block)
+ return if @logger.nil?
+
bm = Benchmark.measure do
block.call
end

0 comments on commit 577a22c

Please sign in to comment.