Take the 2-minute tour ×

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 ?

share|improve this question
add comment

1 Answer

up vote 70 down vote accepted
timing = Benchmark.measure { Post.all }

The various attributes of the object returned (Benchmark::Tms) are provided here.

share|improve this answer
works great thanks –  Bohdan Aug 19 '10 at 13:39
add comment

Your Answer


