How to get execution time in rails console?

Viewed 42982

I want compare time of execution Post.all and SELECT * FROM posts (or some other statements) How can i get execution time of Post.all ?

3 Answers

Here is my version of how to measure performance automatically in rails console using gem: https://github.com/igorkasyanchuk/execution_time

It's showing similar information which you already see during requests.

Sample:

[METRICS] Completed in 908.3ms | Allocations: 2894 | ActiveRecord: 0.9ms (queries: 13)

Related