Display Page Load Time in Rails 3 -


how can display page load time in view, similar how log file shows "completed 200 ok in 19ms (views: 16.8ms | models: 0.497ms)"

you might want use seconds better:

class applicationcontroller < actioncontroller::base    before_filter :set_start_time    def set_start_time     @start_time = time.now.to_f   end  end 

view code:

page rendered in <%= sprintf('%.3f', (time.now.to_f - @start_time) ) %> seconds 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -