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
Post a Comment