# Display the time between a request and a response

**URL:** <https://www.ruby-forum.com/t/display-the-time-between-a-request-and-a-response/103798>\
**Category:** Rails\
**Created:** [May 10, 2007, 1:08pm UTC](https://www.ruby-forum.com/t/display-the-time-between-a-request-and-a-response/103798 "2007-05-10T13:08:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pascal\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3da27b/32.png) [@Pascal\_F](https://www.ruby-forum.com/u/Pascal_F)\
**Post date:** [May 10, 2007, 1:08pm UTC](https://www.ruby-forum.com/t/display-the-time-between-a-request-and-a-response/103798/1 "2007-05-10T13:08:58Z")

</div>

Hi,

i want to display the time that rails needs to render / process a  
request from the user. From start -\> a request from a user is  
recieved by my application -\> the db requests and all the logics  
are processed -\> the view is rendered -\> the response is beeing send -

> stop.

I dont want to do this with apache benchmark or s.th. like that. Just  
with ruby / rails stuff. I dont want to add the Webserver overhead,  
just the  
time rails needs to process a request from recieve to response so i  
can  
show it in each view at the bottom of the page.

is there a rails / ruby way to do this?

Pascal

---

<div class="post-metadata">

**Author:** ![Pascal\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3da27b/32.png) [@Pascal\_F](https://www.ruby-forum.com/u/Pascal_F)\
**Post date:** [May 10, 2007, 1:18pm UTC](https://www.ruby-forum.com/t/display-the-time-between-a-request-and-a-response/103798/2 "2007-05-10T13:18:58Z")

</div>

Pascal,

> i want to display the time that rails needs to render / process a  
> request from the user. From start → a request from a user is

Try the  
Timer plugin

I would use code like this in the page footer :  
\<% if current\_user\_is\_admin? -%\>  
  
\<% end %\>

Another valuable plugin is the  
query\_stats plugin  
[http://agilewebdevelopment.com/plugins/query\_stats](http://agilewebdevelopment.com/plugins/query_stats)  
It tells you about the DB related activities. Very useful to find the  
slow spots to cache.

## Alain

[blog.ravet.com](http://blog.ravet.com)

---

<div class="post-metadata">

**Author:** ![Pascal\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3da27b/32.png) [@Pascal\_F](https://www.ruby-forum.com/u/Pascal_F)\
**Post date:** [May 10, 2007, 1:18pm UTC](https://www.ruby-forum.com/t/display-the-time-between-a-request-and-a-response/103798/3 "2007-05-10T13:18:59Z")

</div>

> the Timer plugin

[http://agilewebdevelopment.com/plugins/timer](http://agilewebdevelopment.com/plugins/timer)
