From e8c4939fb3366472021c1af1331bfdfe5d7a5d75 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 9 Dec 2008 11:17:11 -0800 Subject: Benchmark.ms --- actionpack/lib/action_view/helpers/benchmark_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view') 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 -- cgit v1.2.3