views:

30

answers:

1

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  A: 
timing = Benchmark.measure { Post.all }

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

Shadwell
works great thanks
Bohdan Pohorilets