Check out example codes for "rails c add timings". It will help you in understanding the concepts better.

Code Example 1

def time(&block) puts Benchmark.measure(&block) end

Learn ReactJs, React Native from akashmittal.com