diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-09-05 14:22:10 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-09-05 14:22:57 +0200 |
commit | de0e7507de826bf77fd57cc2a51e27388cb62ff7 (patch) | |
tree | 60d923008716ef32943bb6caef4b6faf504a0970 /actionpack/lib/action_view | |
parent | cf0467c6425a528acfe2cb14709253a8a4a99b37 (diff) | |
download | rails-de0e7507de826bf77fd57cc2a51e27388cb62ff7.tar.gz rails-de0e7507de826bf77fd57cc2a51e27388cb62ff7.tar.bz2 rails-de0e7507de826bf77fd57cc2a51e27388cb62ff7.zip |
Changed all benchmarking reports to be in milliseconds
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/benchmark_helper.rb | 6 |
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 743d1d40ec..2401338896 100644 --- a/actionpack/lib/action_view/helpers/benchmark_helper.rb +++ b/actionpack/lib/action_view/helpers/benchmark_helper.rb @@ -15,15 +15,15 @@ module ActionView # <%= expensive_files_operation %> # <% end %> # - # That would add something like "Process data files (0.34523)" to the log, + # That would add something like "Process data files (345.23ms)" to the log, # which you can then use to compare timings when optimizing your code. # # You may give an optional logger level as the second argument # (:debug, :info, :warn, :error); the default value is :info. def benchmark(message = "Benchmarking", level = :info) if controller.logger - real = Benchmark.realtime { yield } - controller.logger.send(level, "#{message} (#{'%.5f' % real})") + seconds = Benchmark.realtime { yield } + controller.logger.send(level, "#{message} (#{'%.2f' % (seconds * 1000)}ms)") else yield end |