# Server response time

**URL:** <https://www.ruby-forum.com/t/server-response-time/73800>\
**Category:** Ruby\
**Created:** [October 27, 2006, 4:42am UTC](https://www.ruby-forum.com/t/server-response-time/73800 "2006-10-27T04:42:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 27, 2006, 4:42am UTC](https://www.ruby-forum.com/t/server-response-time/73800/1 "2006-10-27T04:42:52Z")

</div>

Hello,

I just started using SugarCRM an online CRM tool. I noticed that at  
the bottom of the page it would print out the following line for every  
page

Server response time: 0.315068 seconds.

Is there a way to do the same in Ruby on Rails?

Janak

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 27, 2006, 4:46am UTC](https://www.ruby-forum.com/t/server-response-time/73800/2 "2006-10-27T04:46:52Z")

</div>

Hu,  
I would try teh ruby on rails mailing list

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 27, 2006, 4:52am UTC](https://www.ruby-forum.com/t/server-response-time/73800/3 "2006-10-27T04:52:52Z")

</div>

On 10/26/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> I just started using SugarCRM an online CRM tool. I noticed that at  
> the bottom of the page it would print out the following line for every  
> page
> 
> Server response time: 0.315068 seconds.
> 
> Is there a way to do the same in Ruby on Rails?

Check out perform\_action\_with\_benchmark in  
actionpack/lib/action\_controller/benchmarking.rb

It contains a line of code like this:  
runtime = [Benchmark::measure{ perform\_action\_without\_benchmark  
}.real, 0.0001].max

You could add a line of code there that saved runtime to an instance  
variable, and put it in the ActionController scope, so that you could  
display it to the user. By default, it only goes to the log file.
