aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/benchmark_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/benchmark_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/benchmark_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/benchmark_helper.rb b/actionpack/lib/action_view/helpers/benchmark_helper.rb
index bd72cda700..372d24a22e 100644
--- a/actionpack/lib/action_view/helpers/benchmark_helper.rb
+++ b/actionpack/lib/action_view/helpers/benchmark_helper.rb
@@ -22,12 +22,12 @@ module ActionView
# (:debug, :info, :warn, :error); the default value is :info.
def benchmark(message = "Benchmarking", level = :info)
if controller.logger
- seconds = Benchmark.realtime { yield }
- controller.logger.send(level, "#{message} (#{'%.1f' % (seconds * 1000)}ms)")
+ ms = Benchmark.ms { yield }
+ controller.logger.send(level, '%s (%.1fms)' % [message, ms])
else
yield
end
end
end
end
-end \ No newline at end of file
+end