How I can display a timer, like google do with "(0.33 seconds)", on each page?
Thanks
How I can display a timer, like google do with "(0.33 seconds)", on each page?
Thanks
I just put up a plugin today to do just that:
http://www.agilewebdevelopment.com/plugins/timer
V/r Anthony Eden
This works for me:
in app/controllers/application.rb: class ApplicationController < ActionController::Base before_filter :set_start_time
def set_start_time @start_time = Time.now end
end
in app/views/layouts/application
.rb (preferably after @content_for_layout is called):
<%= “Time: #{Time.now - @start_time} seconds” %>